aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c25
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 */
64bool __read_mostly tracing_selftest_disabled; 64bool __read_mostly tracing_selftest_disabled;
65 65
66/* Pipe tracepoints to printk */
67struct trace_iterator *tracepoint_print_iter;
68int tracepoint_printk;
69
66/* For tracers that don't implement custom flags */ 70/* For tracers that don't implement custom flags */
67static struct tracer_opt dummy_tracer_opt[] = { 71static 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
200static 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
197unsigned long long ns2usecs(cycle_t nsec) 208unsigned long long ns2usecs(cycle_t nsec)
198{ 209{
@@ -6898,6 +6909,19 @@ out:
6898 return ret; 6909 return ret;
6899} 6910}
6900 6911
6912void __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
6920early_initcall(tracer_alloc_buffers);
6921fs_initcall(tracer_init_debugfs); 6944fs_initcall(tracer_init_debugfs);
6922late_initcall(clear_boot_tracer); 6945late_initcall(clear_boot_tracer);