Commit 6f4156723c084bfc0c0f72205c541fafb8ad3ded

Authored by Steven Rostedt
Committed by Steven Rostedt
1 parent bcd83ea6cb

tracing: Allow tracers to start at core initcall

There's times during debugging that it is helpful to see traces of early
boot functions. But the tracers are initialized at device_initcall()
which is quite late during the boot process. Setting the kernel command
line parameter ftrace=function will not show anything until the function
tracer is initialized. This prevents being able to trace functions before
device_initcall().

There's no reason that the tracers need to be initialized so late in the
boot process. Move them up to core_initcall() as they still need to come
after early_initcall() which initializes the tracing buffers.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Showing 6 changed files with 7 additions and 8 deletions Side-by-side Diff

kernel/trace/ftrace.c
... ... @@ -2868,7 +2868,7 @@
2868 2868 {
2869 2869 return register_ftrace_command(&ftrace_mod_cmd);
2870 2870 }
2871   -device_initcall(ftrace_mod_cmd_init);
  2871 +core_initcall(ftrace_mod_cmd_init);
2872 2872  
2873 2873 static void function_trace_probe_call(unsigned long ip, unsigned long parent_ip,
2874 2874 struct ftrace_ops *op, struct pt_regs *pt_regs)
... ... @@ -4055,7 +4055,7 @@
4055 4055 ftrace_enabled = 1;
4056 4056 return 0;
4057 4057 }
4058   -device_initcall(ftrace_nodyn_init);
  4058 +core_initcall(ftrace_nodyn_init);
4059 4059  
4060 4060 static inline int ftrace_init_dyn_debugfs(struct dentry *d_tracer) { return 0; }
4061 4061 static inline void ftrace_startup_enable(int command) { }
kernel/trace/trace_branch.c
... ... @@ -199,7 +199,7 @@
199 199 }
200 200 return register_tracer(&branch_trace);
201 201 }
202   -device_initcall(init_branch_tracer);
  202 +core_initcall(init_branch_tracer);
203 203  
204 204 #else
205 205 static inline
kernel/trace/trace_functions.c
... ... @@ -411,5 +411,5 @@
411 411 init_func_cmd_traceon();
412 412 return register_tracer(&function_trace);
413 413 }
414   -device_initcall(init_function_trace);
  414 +core_initcall(init_function_trace);
kernel/trace/trace_functions_graph.c
... ... @@ -1474,5 +1474,5 @@
1474 1474 return register_tracer(&graph_trace);
1475 1475 }
1476 1476  
1477   -device_initcall(init_graph_trace);
  1477 +core_initcall(init_graph_trace);
kernel/trace/trace_irqsoff.c
... ... @@ -698,5 +698,5 @@
698 698  
699 699 return 0;
700 700 }
701   -device_initcall(init_irqsoff_tracer);
  701 +core_initcall(init_irqsoff_tracer);
kernel/trace/trace_sched_wakeup.c
... ... @@ -637,5 +637,5 @@
637 637  
638 638 return 0;
639 639 }
640   -device_initcall(init_wakeup_tracer);
  640 +core_initcall(init_wakeup_tracer);