diff options
-rw-r--r-- | kernel/trace/trace.h | 17 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 10 |
2 files changed, 17 insertions, 10 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 */ |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index ca624df7359..238ea95a411 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -24,16 +24,6 @@ static DEFINE_MUTEX(event_mutex); | |||
24 | (unsigned long)event < (unsigned long)__stop_ftrace_events; \ | 24 | (unsigned long)event < (unsigned long)__stop_ftrace_events; \ |
25 | event++) | 25 | event++) |
26 | 26 | ||
27 | void event_trace_printk(unsigned long ip, const char *fmt, ...) | ||
28 | { | ||
29 | va_list ap; | ||
30 | |||
31 | va_start(ap, fmt); | ||
32 | tracing_record_cmdline(current); | ||
33 | trace_vprintk(ip, task_curr_ret_stack(current), fmt, ap); | ||
34 | va_end(ap); | ||
35 | } | ||
36 | |||
37 | static void ftrace_clear_events(void) | 27 | static void ftrace_clear_events(void) |
38 | { | 28 | { |
39 | struct ftrace_event_call *call = (void *)__start_ftrace_events; | 29 | struct ftrace_event_call *call = (void *)__start_ftrace_events; |