tracing: Always show all tracer options in the options directory
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 29 Sep 2015 21:31:55 +0000 (17:31 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 30 Sep 2015 08:34:54 +0000 (04:34 -0400)
commit41d9c0beccbb92397bea8b04a6afd1253c064a1a
tree34c1bbde8d38381cbf40b8f456db6315278f56be
parent73dddbb57bb08d465dd0ecab93db0c5209e50cfe
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>
kernel/trace/trace.c
kernel/trace/trace.h