diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ab76b7bcb36a..2e767972e99c 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -63,6 +63,10 @@ static bool __read_mostly tracing_selftest_running; | |||
63 | */ | 63 | */ |
64 | bool __read_mostly tracing_selftest_disabled; | 64 | bool __read_mostly tracing_selftest_disabled; |
65 | 65 | ||
66 | /* Pipe tracepoints to printk */ | ||
67 | struct trace_iterator *tracepoint_print_iter; | ||
68 | int tracepoint_printk; | ||
69 | |||
66 | /* For tracers that don't implement custom flags */ | 70 | /* For tracers that don't implement custom flags */ |
67 | static struct tracer_opt dummy_tracer_opt[] = { | 71 | static struct tracer_opt dummy_tracer_opt[] = { |
68 | { } | 72 | { } |
@@ -193,6 +197,13 @@ static int __init set_trace_boot_clock(char *str) | |||
193 | } | 197 | } |
194 | __setup("trace_clock=", set_trace_boot_clock); | 198 | __setup("trace_clock=", set_trace_boot_clock); |
195 | 199 | ||
200 | static int __init set_tracepoint_printk(char *str) | ||
201 | { | ||
202 | if ((strcmp(str, "=0") != 0 && strcmp(str, "=off") != 0)) | ||
203 | tracepoint_printk = 1; | ||
204 | return 1; | ||
205 | } | ||
206 | __setup("tp_printk", set_tracepoint_printk); | ||
196 | 207 | ||
197 | unsigned long long ns2usecs(cycle_t nsec) | 208 | unsigned long long ns2usecs(cycle_t nsec) |
198 | { | 209 | { |
@@ -6898,6 +6909,19 @@ out: | |||
6898 | return ret; | 6909 | return ret; |
6899 | } | 6910 | } |
6900 | 6911 | ||
6912 | void __init trace_init(void) | ||
6913 | { | ||
6914 | if (tracepoint_printk) { | ||
6915 | tracepoint_print_iter = | ||
6916 | kmalloc(sizeof(*tracepoint_print_iter), GFP_KERNEL); | ||
6917 | if (WARN_ON(!tracepoint_print_iter)) | ||
6918 | tracepoint_printk = 0; | ||
6919 | } | ||
6920 | tracer_alloc_buffers(); | ||
6921 | init_ftrace_syscalls(); | ||
6922 | trace_event_init(); | ||
6923 | } | ||
6924 | |||
6901 | __init static int clear_boot_tracer(void) | 6925 | __init static int clear_boot_tracer(void) |
6902 | { | 6926 | { |
6903 | /* | 6927 | /* |
@@ -6917,6 +6941,5 @@ __init static int clear_boot_tracer(void) | |||
6917 | return 0; | 6941 | return 0; |
6918 | } | 6942 | } |
6919 | 6943 | ||
6920 | early_initcall(tracer_alloc_buffers); | ||
6921 | fs_initcall(tracer_init_debugfs); | 6944 | fs_initcall(tracer_init_debugfs); |
6922 | late_initcall(clear_boot_tracer); | 6945 | late_initcall(clear_boot_tracer); |