Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0778d9ad authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt
Browse files

ftrace: Make FTRACE_WARN_ON() work in if condition



Let FTRACE_WARN_ON() be used as a stand alone statement or
inside a conditional: if (FTRACE_WARN_ON(x))

Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 32673822
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -39,16 +39,20 @@
#include "trace_stat.h"
#include "trace_stat.h"


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


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


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