diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2015-09-30 12:30:06 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-09-30 15:22:57 -0400 |
commit | 16270145ce6b90750bbe4f9365865f65037b2027 (patch) | |
tree | f33b778b58d96257d08d03c569c248dbbe9b4779 /kernel | |
parent | 2d34f48955158cfdf18704256c84b04fe3a16c7b (diff) |
tracing: Add trace options for core options to instances
Allow instances to have their own options, at least for the core options
(non tracer specific ones). There are a few global options that should not
be added to instances, like enabling of trace_printk, and the sched comm
recording, which do not have a specific trace instance associated to them.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 51697b41f5d4..7b99e36b8973 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -258,6 +258,11 @@ unsigned long long ns2usecs(cycle_t nsec) | |||
258 | TRACE_ITER_RECORD_CMD | TRACE_ITER_OVERWRITE | \ | 258 | TRACE_ITER_RECORD_CMD | TRACE_ITER_OVERWRITE | \ |
259 | TRACE_ITER_IRQ_INFO | TRACE_ITER_MARKERS) | 259 | TRACE_ITER_IRQ_INFO | TRACE_ITER_MARKERS) |
260 | 260 | ||
261 | /* trace_options that are only supported by global_trace */ | ||
262 | #define TOP_LEVEL_TRACE_FLAGS (TRACE_ITER_PRINTK | \ | ||
263 | TRACE_ITER_PRINTK_MSGONLY | TRACE_ITER_RECORD_CMD) | ||
264 | |||
265 | |||
261 | /* | 266 | /* |
262 | * The global_trace is the descriptor that holds the tracing | 267 | * The global_trace is the descriptor that holds the tracing |
263 | * buffers for the live tracing. For each CPU, it contains | 268 | * buffers for the live tracing. For each CPU, it contains |
@@ -6387,17 +6392,21 @@ create_trace_option_core_file(struct trace_array *tr, | |||
6387 | &trace_options_core_fops); | 6392 | &trace_options_core_fops); |
6388 | } | 6393 | } |
6389 | 6394 | ||
6390 | static __init void create_trace_options_dir(struct trace_array *tr) | 6395 | static void create_trace_options_dir(struct trace_array *tr) |
6391 | { | 6396 | { |
6392 | struct dentry *t_options; | 6397 | struct dentry *t_options; |
6398 | bool top_level = tr == &global_trace; | ||
6393 | int i; | 6399 | int i; |
6394 | 6400 | ||
6395 | t_options = trace_options_init_dentry(tr); | 6401 | t_options = trace_options_init_dentry(tr); |
6396 | if (!t_options) | 6402 | if (!t_options) |
6397 | return; | 6403 | return; |
6398 | 6404 | ||
6399 | for (i = 0; trace_options[i]; i++) | 6405 | for (i = 0; trace_options[i]; i++) { |
6400 | create_trace_option_core_file(tr, trace_options[i], i); | 6406 | if (top_level || |
6407 | !((1 << i) & TOP_LEVEL_TRACE_FLAGS)) | ||
6408 | create_trace_option_core_file(tr, trace_options[i], i); | ||
6409 | } | ||
6401 | } | 6410 | } |
6402 | 6411 | ||
6403 | static ssize_t | 6412 | static ssize_t |
@@ -6707,6 +6716,8 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer) | |||
6707 | trace_create_file("tracing_on", 0644, d_tracer, | 6716 | trace_create_file("tracing_on", 0644, d_tracer, |
6708 | tr, &rb_simple_fops); | 6717 | tr, &rb_simple_fops); |
6709 | 6718 | ||
6719 | create_trace_options_dir(tr); | ||
6720 | |||
6710 | #ifdef CONFIG_TRACER_MAX_TRACE | 6721 | #ifdef CONFIG_TRACER_MAX_TRACE |
6711 | trace_create_file("tracing_max_latency", 0644, d_tracer, | 6722 | trace_create_file("tracing_max_latency", 0644, d_tracer, |
6712 | &tr->max_latency, &tracing_max_lat_fops); | 6723 | &tr->max_latency, &tracing_max_lat_fops); |
@@ -6903,8 +6914,6 @@ static __init int tracer_init_tracefs(void) | |||
6903 | 6914 | ||
6904 | create_trace_instances(d_tracer); | 6915 | create_trace_instances(d_tracer); |
6905 | 6916 | ||
6906 | create_trace_options_dir(&global_trace); | ||
6907 | |||
6908 | mutex_lock(&trace_types_lock); | 6917 | mutex_lock(&trace_types_lock); |
6909 | for (t = trace_types; t; t = t->next) | 6918 | for (t = trace_types; t; t = t->next) |
6910 | add_tracer_options(&global_trace, t); | 6919 | add_tracer_options(&global_trace, t); |