diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-12-12 20:05:10 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-12-15 10:16:50 -0500 |
commit | 5f893b2639b21ffe6834b1aebba392c37d2b83f9 (patch) | |
tree | aff7db6baf3dd393a4791f2106ebacbe02b1ae5b /kernel | |
parent | aee4e5f3d3abb7a2239dd02f6d8fb173413fd02f (diff) |
tracing: Move enabling tracepoints to just after rcu_init()
Enabling tracepoints at boot up can be very useful. The tracepoint
can be initialized right after RCU has been. There's no need to
wait for the early_initcall() to be called. That's too late for some
things that can use tracepoints for debugging. Move the logic to
enable tracepoints out of the initcalls and into init/main.c to
right after rcu_init().
This also allows trace_printk() to be used early too.
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1412121539300.16494@nanos
Link: http://lkml.kernel.org/r/20141214164104.307127356@goodmis.org
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace.h | 13 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 10 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 7 |
4 files changed, 30 insertions, 8 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 4ceb2546c7ef..ec3ca694665f 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -6876,6 +6876,13 @@ out: | |||
6876 | return ret; | 6876 | return ret; |
6877 | } | 6877 | } |
6878 | 6878 | ||
6879 | void __init trace_init(void) | ||
6880 | { | ||
6881 | tracer_alloc_buffers(); | ||
6882 | init_ftrace_syscalls(); | ||
6883 | trace_event_init(); | ||
6884 | } | ||
6885 | |||
6879 | __init static int clear_boot_tracer(void) | 6886 | __init static int clear_boot_tracer(void) |
6880 | { | 6887 | { |
6881 | /* | 6888 | /* |
@@ -6895,6 +6902,5 @@ __init static int clear_boot_tracer(void) | |||
6895 | return 0; | 6902 | return 0; |
6896 | } | 6903 | } |
6897 | 6904 | ||
6898 | early_initcall(tracer_alloc_buffers); | ||
6899 | fs_initcall(tracer_init_debugfs); | 6905 | fs_initcall(tracer_init_debugfs); |
6900 | late_initcall(clear_boot_tracer); | 6906 | late_initcall(clear_boot_tracer); |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 3255dfb054a0..c138c149d6ef 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -1301,4 +1301,17 @@ int perf_ftrace_event_register(struct ftrace_event_call *call, | |||
1301 | #define perf_ftrace_event_register NULL | 1301 | #define perf_ftrace_event_register NULL |
1302 | #endif | 1302 | #endif |
1303 | 1303 | ||
1304 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
1305 | void init_ftrace_syscalls(void); | ||
1306 | #else | ||
1307 | static inline void init_ftrace_syscalls(void) { } | ||
1308 | #endif | ||
1309 | |||
1310 | #ifdef CONFIG_EVENT_TRACING | ||
1311 | void trace_event_init(void); | ||
1312 | #else | ||
1313 | static inline void __init trace_event_init(void) { } | ||
1314 | #endif | ||
1315 | |||
1316 | |||
1304 | #endif /* _LINUX_KERNEL_TRACE_H */ | 1317 | #endif /* _LINUX_KERNEL_TRACE_H */ |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f9d0cbe014b7..fd9deb0e03f0 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -2477,8 +2477,14 @@ static __init int event_trace_init(void) | |||
2477 | #endif | 2477 | #endif |
2478 | return 0; | 2478 | return 0; |
2479 | } | 2479 | } |
2480 | early_initcall(event_trace_memsetup); | 2480 | |
2481 | core_initcall(event_trace_enable); | 2481 | void __init trace_event_init(void) |
2482 | { | ||
2483 | event_trace_memsetup(); | ||
2484 | init_ftrace_syscalls(); | ||
2485 | event_trace_enable(); | ||
2486 | } | ||
2487 | |||
2482 | fs_initcall(event_trace_init); | 2488 | fs_initcall(event_trace_init); |
2483 | 2489 | ||
2484 | #ifdef CONFIG_FTRACE_STARTUP_TEST | 2490 | #ifdef CONFIG_FTRACE_STARTUP_TEST |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index a72f3d8d813e..ec239771c175 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -514,7 +514,7 @@ unsigned long __init __weak arch_syscall_addr(int nr) | |||
514 | return (unsigned long)sys_call_table[nr]; | 514 | return (unsigned long)sys_call_table[nr]; |
515 | } | 515 | } |
516 | 516 | ||
517 | static int __init init_ftrace_syscalls(void) | 517 | void __init init_ftrace_syscalls(void) |
518 | { | 518 | { |
519 | struct syscall_metadata *meta; | 519 | struct syscall_metadata *meta; |
520 | unsigned long addr; | 520 | unsigned long addr; |
@@ -524,7 +524,7 @@ static int __init init_ftrace_syscalls(void) | |||
524 | GFP_KERNEL); | 524 | GFP_KERNEL); |
525 | if (!syscalls_metadata) { | 525 | if (!syscalls_metadata) { |
526 | WARN_ON(1); | 526 | WARN_ON(1); |
527 | return -ENOMEM; | 527 | return; |
528 | } | 528 | } |
529 | 529 | ||
530 | for (i = 0; i < NR_syscalls; i++) { | 530 | for (i = 0; i < NR_syscalls; i++) { |
@@ -536,10 +536,7 @@ static int __init init_ftrace_syscalls(void) | |||
536 | meta->syscall_nr = i; | 536 | meta->syscall_nr = i; |
537 | syscalls_metadata[i] = meta; | 537 | syscalls_metadata[i] = meta; |
538 | } | 538 | } |
539 | |||
540 | return 0; | ||
541 | } | 539 | } |
542 | early_initcall(init_ftrace_syscalls); | ||
543 | 540 | ||
544 | #ifdef CONFIG_PERF_EVENTS | 541 | #ifdef CONFIG_PERF_EVENTS |
545 | 542 | ||