Skip to content

Commit

Permalink
tracing: Only create tracer options files if directory exists
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rostedt committed Feb 3, 2015
1 parent dfbc153 commit 0f67f04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0f67f04

Please sign in to comment.