summaryrefslogtreecommitdiff
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-09-29 17:31:55 -0400
committerSteven Rostedt <rostedt@goodmis.org>2015-09-30 04:34:54 -0400
commit41d9c0beccbb92397bea8b04a6afd1253c064a1a (patch)
tree34c1bbde8d38381cbf40b8f456db6315278f56be /kernel/trace/trace.h
parent73dddbb57bb08d465dd0ecab93db0c5209e50cfe (diff)
tracing: Always show all tracer options in the options directory
There are options that are unique to a specific tracer (like function and function graph). Currently, these options are only visible in the options directory when the tracer is enabled. This has been a pain, especially for something like the func_stack_trace option that if used inappropriately, could bring the system to a crawl. But the only way to see it, is to enable the function tracer. For example, if one had done: # cd /sys/kernel/tracing # echo __schedule > set_ftrace_filter # echo 1 > options/func_stack_trace # echo function > current_tracer The __schedule call will be traced and a stack trace will also be recorded there. Now when you were done, you may do... # echo nop > current_tracer # echo > set_ftrace_filter But you forgot to disable the func_stack_trace. The only way to disable it is to re-enable function tracing first. If you do not add a filter to set_ftrace_filter and just do: # echo function > current_tracer Now you would be performing a stack trace on *every* function! On some systems, that causes a live lock. Others may take a few minutes to fix your mistake. Having the func_stack_trace option visible allows you to check it and disable it before enabling the funtion tracer. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index af34e1822dad..8ed97872b65b 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -333,6 +333,13 @@ struct tracer_flags {
#define TRACER_OPT(s, b) .name = #s, .bit = b
+struct trace_option_dentry {
+ struct tracer_opt *opt;
+ struct tracer_flags *flags;
+ struct trace_array *tr;
+ struct dentry *entry;
+};
+
/**
* struct tracer - a specific tracer and its callbacks to interact with tracefs
* @name: the name chosen to select it on the available_tracers file
@@ -387,6 +394,7 @@ struct tracer {
u32 mask, int set);
struct tracer *next;
struct tracer_flags *flags;
+ struct trace_option_dentry *topts;
int enabled;
int ref;
bool print_max;