Skip to content

Commit

Permalink
ftrace: Make FTRACE_WARN_ON() work in if condition
Browse files Browse the repository at this point in the history
Let FTRACE_WARN_ON() be used as a stand alone statement or
inside a conditional: if (FTRACE_WARN_ON(x))

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Apr 30, 2011
1 parent 3267382 commit 0778d9a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,20 @@
#include "trace_stat.h"

#define FTRACE_WARN_ON(cond) \
do { \
if (WARN_ON(cond)) \
({ \
int ___r = cond; \
if (WARN_ON(___r)) \
ftrace_kill(); \
} while (0)
___r; \
})

#define FTRACE_WARN_ON_ONCE(cond) \
do { \
if (WARN_ON_ONCE(cond)) \
({ \
int ___r = cond; \
if (WARN_ON_ONCE(___r)) \
ftrace_kill(); \
} while (0)
___r; \
})

/* hash bits for specific function selection */
#define FTRACE_HASH_BITS 7
Expand Down

0 comments on commit 0778d9a

Please sign in to comment.