Commit 6752ab4a authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

tracing: Deprecate tracing_enabled for tracing_on

tracing_enabled should not be used, it is heavy weight and does not
do much in helping lower the overhead.

tracing_on should be used instead. Warn users to use tracing_on
when tracing_enabled is used as it will soon be removed from the
tracing directory.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 87d80de2
...@@ -80,11 +80,11 @@ of ftrace. Here is a list of some of the key files: ...@@ -80,11 +80,11 @@ of ftrace. Here is a list of some of the key files:
tracers listed here can be configured by tracers listed here can be configured by
echoing their name into current_tracer. echoing their name into current_tracer.
tracing_enabled: tracing_on:
This sets or displays whether the current_tracer This sets or displays whether writing to the trace
is activated and tracing or not. Echo 0 into this ring buffer is enabled. Echo 0 into this file to disable
file to disable the tracer or 1 to enable it. the tracer or 1 to enable it.
trace: trace:
...@@ -497,10 +497,10 @@ an example: ...@@ -497,10 +497,10 @@ an example:
# echo irqsoff > current_tracer # echo irqsoff > current_tracer
# echo latency-format > trace_options # echo latency-format > trace_options
# echo 0 > tracing_max_latency # echo 0 > tracing_max_latency
# echo 1 > tracing_enabled # echo 1 > tracing_on
# ls -ltr # ls -ltr
[...] [...]
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: irqsoff # tracer: irqsoff
# #
...@@ -605,10 +605,10 @@ is much like the irqsoff tracer. ...@@ -605,10 +605,10 @@ is much like the irqsoff tracer.
# echo preemptoff > current_tracer # echo preemptoff > current_tracer
# echo latency-format > trace_options # echo latency-format > trace_options
# echo 0 > tracing_max_latency # echo 0 > tracing_max_latency
# echo 1 > tracing_enabled # echo 1 > tracing_on
# ls -ltr # ls -ltr
[...] [...]
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: preemptoff # tracer: preemptoff
# #
...@@ -753,10 +753,10 @@ tracers. ...@@ -753,10 +753,10 @@ tracers.
# echo preemptirqsoff > current_tracer # echo preemptirqsoff > current_tracer
# echo latency-format > trace_options # echo latency-format > trace_options
# echo 0 > tracing_max_latency # echo 0 > tracing_max_latency
# echo 1 > tracing_enabled # echo 1 > tracing_on
# ls -ltr # ls -ltr
[...] [...]
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: preemptirqsoff # tracer: preemptirqsoff
# #
...@@ -916,9 +916,9 @@ Instead of performing an 'ls', we will run 'sleep 1' under ...@@ -916,9 +916,9 @@ Instead of performing an 'ls', we will run 'sleep 1' under
# echo wakeup > current_tracer # echo wakeup > current_tracer
# echo latency-format > trace_options # echo latency-format > trace_options
# echo 0 > tracing_max_latency # echo 0 > tracing_max_latency
# echo 1 > tracing_enabled # echo 1 > tracing_on
# chrt -f 5 sleep 1 # chrt -f 5 sleep 1
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: wakeup # tracer: wakeup
# #
...@@ -1030,9 +1030,9 @@ ftrace_enabled is set; otherwise this tracer is a nop. ...@@ -1030,9 +1030,9 @@ ftrace_enabled is set; otherwise this tracer is a nop.
# sysctl kernel.ftrace_enabled=1 # sysctl kernel.ftrace_enabled=1
# echo function > current_tracer # echo function > current_tracer
# echo 1 > tracing_enabled # echo 1 > tracing_on
# usleep 1 # usleep 1
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: function # tracer: function
# #
...@@ -1070,7 +1070,7 @@ int trace_fd; ...@@ -1070,7 +1070,7 @@ int trace_fd;
[...] [...]
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
[...] [...]
trace_fd = open(tracing_file("tracing_enabled"), O_WRONLY); trace_fd = open(tracing_file("tracing_on"), O_WRONLY);
[...] [...]
if (condition_hit()) { if (condition_hit()) {
write(trace_fd, "0", 1); write(trace_fd, "0", 1);
...@@ -1521,9 +1521,9 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt: ...@@ -1521,9 +1521,9 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt:
# echo sys_nanosleep hrtimer_interrupt \ # echo sys_nanosleep hrtimer_interrupt \
> set_ftrace_filter > set_ftrace_filter
# echo function > current_tracer # echo function > current_tracer
# echo 1 > tracing_enabled # echo 1 > tracing_on
# usleep 1 # usleep 1
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: ftrace # tracer: ftrace
# #
...@@ -1769,9 +1769,9 @@ different. The trace is live. ...@@ -1769,9 +1769,9 @@ different. The trace is live.
# echo function > current_tracer # echo function > current_tracer
# cat trace_pipe > /tmp/trace.out & # cat trace_pipe > /tmp/trace.out &
[1] 4153 [1] 4153
# echo 1 > tracing_enabled # echo 1 > tracing_on
# usleep 1 # usleep 1
# echo 0 > tracing_enabled # echo 0 > tracing_on
# cat trace # cat trace
# tracer: function # tracer: function
# #
......
...@@ -2710,6 +2710,10 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf, ...@@ -2710,6 +2710,10 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
mutex_lock(&trace_types_lock); mutex_lock(&trace_types_lock);
if (tracer_enabled ^ val) { if (tracer_enabled ^ val) {
/* Only need to warn if this is used to change the state */
WARN_ONCE(1, "tracing_enabled is deprecated. Use tracing_on");
if (val) { if (val) {
tracer_enabled = 1; tracer_enabled = 1;
if (current_trace->start) if (current_trace->start)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment