tracing: Prevent wasting time evaluating parameters in trace_preempt_on/off
PATCH 1/1 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.
Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Turner <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Hidetoshi Seto <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Josh Triplett <[email protected]>
Signed-off-by Minho Ban <[email protected]>
Acked-by Steven Rostedt <[email protected]>
--- include/linux/ftrace.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
include/linux/ftrace.h +6 -2
@@ -485,8 +485,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
Signature · 1 line
1.7.5.4
Commit-ID: b02ee9a33b65bcc4ad13c12a0b04afdaab3ddd8d Gitweb: http://git.kernel.org/tip/b02ee9a33b65bcc4ad13c12a0b04afdaab3ddd8d Author: Minho Ban <[email protected]> AuthorDate: Mon, 7 May 2012 11:36:00 +0900 Committer: Steven Rostedt <[email protected]> CommitDate: Tue, 8 May 2012 09:33:52 -0400
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.
Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Turner <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Hidetoshi Seto <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Josh Triplett <[email protected]>
Signed-off-by Minho Ban <[email protected]>
Signed-off-by Steven Rostedt <[email protected]>
--- include/linux/ftrace.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
include/linux/ftrace.h +6 -2
@@ -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