summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-02-03 17:56:20 +0100
committerSteven Rostedt <rostedt@goodmis.org>2015-02-03 18:48:38 +0100
commit0f67f04ffcb592d065a20862a82d4539e0f8e909 (patch)
treef4c574d454ecd79054291cf2ed868706a4501fd6
parentMerge branch 'debugfs_automount' of git://git.kernel.org/pub/scm/linux/kernel... (diff)
downloadlinux-0f67f04ffcb592d065a20862a82d4539e0f8e909.tar.xz
linux-0f67f04ffcb592d065a20862a82d4539e0f8e909.zip
tracing: Only create tracer options files if directory exists
Do not bother creating tracer options if no tracing directory exists. If a tracer is enabled via the command line, and is started before the tracing directory is created, then it wont have its tracer specific options created. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/trace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 38c613ede10d..d4627f15407a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4172,8 +4172,11 @@ static int tracing_set_tracer(struct trace_array *tr, const char *buf)
free_snapshot(tr);
}
#endif
- /* Currently, only the top instance has options */
- if (tr->flags & TRACE_ARRAY_FL_GLOBAL) {
+ /*
+ * Only enable if the directory has been created already.
+ * Currently, only the top instance has options
+ */
+ if (tr->dir && tr->flags & TRACE_ARRAY_FL_GLOBAL) {
destroy_trace_option_files(topts);
topts = create_trace_option_files(tr, t);
}