Skip to content

Commit

Permalink
tracing: Register the ftrace internal events during early boot
Browse files Browse the repository at this point in the history
All trace events including ftrace internel events (like trace_printk
and function tracing), register functions that describe how to print
their output. The events may be recorded as soon as the ring buffer
is allocated, but they are just raw binary in the buffer. The mapping
of event ids to how to print them are held within a structure that
is registered on system boot.

If a crash happens in boot up before these functions are registered
then their output (via ftrace_dump_on_oops) will be useless:

Dumping ftrace buffer:
---------------------------------
   <...>-1       0.... 319705us : Unknown type 6
---------------------------------

This can be quite frustrating for a kernel developer trying to see
what is going wrong.

There's no reason to register them so late in the boot up process.
They can be registered by early_initcall().

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jun 14, 2012
1 parent 5da43be commit 7374e82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,4 +1325,4 @@ __init static int init_events(void)

return 0;
}
device_initcall(init_events);
early_initcall(init_events);

0 comments on commit 7374e82

Please sign in to comment.