]> Pileus Git - ~andy/linux/commitdiff
tracing: Deprecate tracing_enabled for tracing_on
authorSteven Rostedt <srostedt@redhat.com>
Tue, 8 Feb 2011 18:54:06 +0000 (13:54 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 8 Feb 2011 22:14:58 +0000 (17:14 -0500)
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: Steven Rostedt <rostedt@goodmis.org>
Documentation/trace/ftrace.txt
kernel/trace/trace.c

index 65eddb7cfa0256beedf04e469ee3098663740e23..67f1cc473257b6e646dcd27a3d9b7800096ecacd 100644 (file)
@@ -80,11 +80,11 @@ of ftrace. Here is a list of some of the key files:
        tracers listed here can be configured by
        echoing their name into current_tracer.
 
-  tracing_enabled:
+  tracing_on:
 
-       This sets or displays whether the current_tracer
-       is activated and tracing or not. Echo 0 into this
-       file to disable the tracer or 1 to enable it.
+       This sets or displays whether writing to the trace
+       ring buffer is enabled. Echo 0 into this file to disable
+       the tracer or 1 to enable it.
 
   trace:
 
@@ -497,10 +497,10 @@ an example:
  # echo irqsoff > current_tracer
  # echo latency-format > trace_options
  # echo 0 > tracing_max_latency
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # ls -ltr
  [...]
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: irqsoff
 #
@@ -605,10 +605,10 @@ is much like the irqsoff tracer.
  # echo preemptoff > current_tracer
  # echo latency-format > trace_options
  # echo 0 > tracing_max_latency
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # ls -ltr
  [...]
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: preemptoff
 #
@@ -753,10 +753,10 @@ tracers.
  # echo preemptirqsoff > current_tracer
  # echo latency-format > trace_options
  # echo 0 > tracing_max_latency
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # ls -ltr
  [...]
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: preemptirqsoff
 #
@@ -916,9 +916,9 @@ Instead of performing an 'ls', we will run 'sleep 1' under
  # echo wakeup > current_tracer
  # echo latency-format > trace_options
  # echo 0 > tracing_max_latency
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # chrt -f 5 sleep 1
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: wakeup
 #
@@ -1030,9 +1030,9 @@ ftrace_enabled is set; otherwise this tracer is a nop.
 
  # sysctl kernel.ftrace_enabled=1
  # echo function > current_tracer
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # usleep 1
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: function
 #
@@ -1070,7 +1070,7 @@ int trace_fd;
 [...]
 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()) {
                write(trace_fd, "0", 1);
@@ -1521,9 +1521,9 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt:
  # echo sys_nanosleep hrtimer_interrupt \
                > set_ftrace_filter
  # echo function > current_tracer
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # usleep 1
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: ftrace
 #
@@ -1769,9 +1769,9 @@ different. The trace is live.
  # echo function > current_tracer
  # cat trace_pipe > /tmp/trace.out &
 [1] 4153
- # echo 1 > tracing_enabled
+ # echo 1 > tracing_on
  # usleep 1
- # echo 0 > tracing_enabled
+ # echo 0 > tracing_on
  # cat trace
 # tracer: function
 #
index dc53ecb8058919ed329b02c5644c7f23449cce7b..8dc8da6733f97994f79dca7a88ab4a7c4cc4a3f7 100644 (file)
@@ -2710,6 +2710,10 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
 
        mutex_lock(&trace_types_lock);
        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) {
                        tracer_enabled = 1;
                        if (current_trace->start)