diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-12 14:19:25 -0400 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-12 21:15:00 -0400 |
commit | e9fb2b6d5845e24f104713591286b6f39761c027 (patch) | |
tree | 13239f3046b28b9b8b6166e438a4c509e57972c9 /kernel/trace/trace.h | |
parent | 828275574e0161bdddb5817d4bd76a0265ef0470 (diff) |
tracing: have event_trace_printk use static tracer
Impact: speed up on event tracing
The event_trace_printk is currently a wrapper function that calls
trace_vprintk. Because it uses a variable for the fmt it misses out
on the optimization of using the binary printk.
This patch makes event_trace_printk into a macro wrapper to use the
fmt as the same as the trace_printks.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index cede1ab49d0..35cfa7bbaf3 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -773,4 +773,21 @@ void event_trace_printk(unsigned long ip, const char *fmt, ...); | |||
773 | extern struct ftrace_event_call __start_ftrace_events[]; | 773 | extern struct ftrace_event_call __start_ftrace_events[]; |
774 | extern struct ftrace_event_call __stop_ftrace_events[]; | 774 | extern struct ftrace_event_call __stop_ftrace_events[]; |
775 | 775 | ||
776 | extern const char *__start___trace_bprintk_fmt[]; | ||
777 | extern const char *__stop___trace_bprintk_fmt[]; | ||
778 | |||
779 | #define event_trace_printk(ip, fmt, args...) \ | ||
780 | do { \ | ||
781 | __trace_printk_check_format(fmt, ##args); \ | ||
782 | tracing_record_cmdline(current); \ | ||
783 | if (__builtin_constant_p(fmt)) { \ | ||
784 | static const char *trace_printk_fmt \ | ||
785 | __attribute__((section("__trace_printk_fmt"))) = \ | ||
786 | __builtin_constant_p(fmt) ? fmt : NULL; \ | ||
787 | \ | ||
788 | __trace_bprintk(ip, trace_printk_fmt, ##args); \ | ||
789 | } else \ | ||
790 | __trace_printk(ip, fmt, ##args); \ | ||
791 | } while (0) | ||
792 | |||
776 | #endif /* _LINUX_KERNEL_TRACE_H */ | 793 | #endif /* _LINUX_KERNEL_TRACE_H */ |