diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-03-22 18:10:45 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-23 11:25:47 -0400 |
commit | 3e1f60b80cafcb5d7e8d3665b35962fbb8fb9efa (patch) | |
tree | 80b07264a2599f494f9f8eebb7230ceead3ae645 | |
parent | c0f92ba99bdeaf35f9c580291b4e1a657c67fbd4 (diff) |
tracing/ftrace: check if debugfs is registered before creating files
Impact: fix a crash with ftrace={nop,boot} parameter
If the nop or initcall tracers are launched as boot tracers,
they will attempt to create their option directory and files.
But these tracers are registered very early and then assigned
as "boot tracers" very early if asked to.
Since they do this before debugfs has been registered (core initcall),
a crash is triggered.
Another early tracers could also come later. So we fix it by
checking if debugfs is initialized before creating the root
tracing directory.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1237759847-21025-3-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/trace/trace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ace685c70186..f0e1337b1ebd 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3513,6 +3513,9 @@ struct dentry *tracing_init_dentry(void) | |||
3513 | if (d_tracer) | 3513 | if (d_tracer) |
3514 | return d_tracer; | 3514 | return d_tracer; |
3515 | 3515 | ||
3516 | if (!debugfs_initialized()) | ||
3517 | return NULL; | ||
3518 | |||
3516 | d_tracer = debugfs_create_dir("tracing", NULL); | 3519 | d_tracer = debugfs_create_dir("tracing", NULL); |
3517 | 3520 | ||
3518 | if (!d_tracer && !once) { | 3521 | if (!d_tracer && !once) { |