From: Minho Ban Date: Mon, 7 May 2012 02:36:00 +0000 (+0900) Subject: tracing: Prevent wasting time evaluating parameters in trace_preempt_on/off X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b02ee9a33b65bcc4ad13c12a0b04afdaab3ddd8d;p=~shefty%2Frdma-dev.git tracing: Prevent wasting time evaluating parameters in trace_preempt_on/off This fixes spending time for evaluating parameters in trace_preempt_on/off when the tracer config is off. The patch mainly inspired by Steven Rostedt, thanks Steven. Link: http://lkml.kernel.org/r/4FA73510.7070705@samsung.com Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Paul Turner Cc: Thomas Gleixner Cc: Hidetoshi Seto Cc: Paul E. McKenney Cc: Josh Triplett Signed-off-by: Minho Ban Signed-off-by: Steven Rostedt --- diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 0b5590330bc..d32cc5e4b0c 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -491,8 +491,12 @@ static inline void __ftrace_enabled_restore(int enabled) extern void trace_preempt_on(unsigned long a0, unsigned long a1); extern void trace_preempt_off(unsigned long a0, unsigned long a1); #else - static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { } - static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { } +/* + * Use defines instead of static inlines because some arches will make code out + * of the CALLER_ADDR, when we really want these to be a real nop. + */ +# define trace_preempt_on(a0, a1) do { } while (0) +# define trace_preempt_off(a0, a1) do { } while (0) #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD