aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-02-08 13:54:06 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-02-08 17:14:58 -0500
commit6752ab4a9c30d5411b2dfdb251a3f1cb18aae487 (patch)
tree2f6e2bb5b562c43b3b3d7efe095e196a19995395
parent87d80de2800d087ea833cb79bc13f85ff34ed49f (diff)
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: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--Documentation/trace/ftrace.txt38
-rw-r--r--kernel/trace/trace.c4
2 files changed, 23 insertions, 19 deletions
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 65eddb7cfa02..67f1cc473257 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -80,11 +80,11 @@ of ftrace. Here is a list of some of the key files:
80 tracers listed here can be configured by 80 tracers listed here can be configured by
81 echoing their name into current_tracer. 81 echoing their name into current_tracer.
82 82
83 tracing_enabled: 83 tracing_on:
84 84
85 This sets or displays whether the current_tracer 85 This sets or displays whether writing to the trace
86 is activated and tracing or not. Echo 0 into this 86 ring buffer is enabled. Echo 0 into this file to disable
87 file to disable the tracer or 1 to enable it. 87 the tracer or 1 to enable it.
88 88
89 trace: 89 trace:
90 90
@@ -497,10 +497,10 @@ an example:
497 # echo irqsoff > current_tracer 497 # echo irqsoff > current_tracer
498 # echo latency-format > trace_options 498 # echo latency-format > trace_options
499 # echo 0 > tracing_max_latency 499 # echo 0 > tracing_max_latency
500 # echo 1 > tracing_enabled 500 # echo 1 > tracing_on
501 # ls -ltr 501 # ls -ltr
502 [...] 502 [...]
503 # echo 0 > tracing_enabled 503 # echo 0 > tracing_on
504 # cat trace 504 # cat trace
505# tracer: irqsoff 505# tracer: irqsoff
506# 506#
@@ -605,10 +605,10 @@ is much like the irqsoff tracer.
605 # echo preemptoff > current_tracer 605 # echo preemptoff > current_tracer
606 # echo latency-format > trace_options 606 # echo latency-format > trace_options
607 # echo 0 > tracing_max_latency 607 # echo 0 > tracing_max_latency
608 # echo 1 > tracing_enabled 608 # echo 1 > tracing_on
609 # ls -ltr 609 # ls -ltr
610 [...] 610 [...]
611 # echo 0 > tracing_enabled 611 # echo 0 > tracing_on
612 # cat trace 612 # cat trace
613# tracer: preemptoff 613# tracer: preemptoff
614# 614#
@@ -753,10 +753,10 @@ tracers.
753 # echo preemptirqsoff > current_tracer 753 # echo preemptirqsoff > current_tracer
754 # echo latency-format > trace_options 754 # echo latency-format > trace_options
755 # echo 0 > tracing_max_latency 755 # echo 0 > tracing_max_latency
756 # echo 1 > tracing_enabled 756 # echo 1 > tracing_on
757 # ls -ltr 757 # ls -ltr
758 [...] 758 [...]
759 # echo 0 > tracing_enabled 759 # echo 0 > tracing_on
760 # cat trace 760 # cat trace
761# tracer: preemptirqsoff 761# tracer: preemptirqsoff
762# 762#
@@ -916,9 +916,9 @@ Instead of performing an 'ls', we will run 'sleep 1' under
916 # echo wakeup > current_tracer 916 # echo wakeup > current_tracer
917 # echo latency-format > trace_options 917 # echo latency-format > trace_options
918 # echo 0 > tracing_max_latency 918 # echo 0 > tracing_max_latency
919 # echo 1 > tracing_enabled 919 # echo 1 > tracing_on
920 # chrt -f 5 sleep 1 920 # chrt -f 5 sleep 1
921 # echo 0 > tracing_enabled 921 # echo 0 > tracing_on
922 # cat trace 922 # cat trace
923# tracer: wakeup 923# tracer: wakeup
924# 924#
@@ -1030,9 +1030,9 @@ ftrace_enabled is set; otherwise this tracer is a nop.
1030 1030
1031 # sysctl kernel.ftrace_enabled=1 1031 # sysctl kernel.ftrace_enabled=1
1032 # echo function > current_tracer 1032 # echo function > current_tracer
1033 # echo 1 > tracing_enabled 1033 # echo 1 > tracing_on
1034 # usleep 1 1034 # usleep 1
1035 # echo 0 > tracing_enabled 1035 # echo 0 > tracing_on
1036 # cat trace 1036 # cat trace
1037# tracer: function 1037# tracer: function
1038# 1038#
@@ -1070,7 +1070,7 @@ int trace_fd;
1070[...] 1070[...]
1071int main(int argc, char *argv[]) { 1071int main(int argc, char *argv[]) {
1072 [...] 1072 [...]
1073 trace_fd = open(tracing_file("tracing_enabled"), O_WRONLY); 1073 trace_fd = open(tracing_file("tracing_on"), O_WRONLY);
1074 [...] 1074 [...]
1075 if (condition_hit()) { 1075 if (condition_hit()) {
1076 write(trace_fd, "0", 1); 1076 write(trace_fd, "0", 1);
@@ -1521,9 +1521,9 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt:
1521 # echo sys_nanosleep hrtimer_interrupt \ 1521 # echo sys_nanosleep hrtimer_interrupt \
1522 > set_ftrace_filter 1522 > set_ftrace_filter
1523 # echo function > current_tracer 1523 # echo function > current_tracer
1524 # echo 1 > tracing_enabled 1524 # echo 1 > tracing_on
1525 # usleep 1 1525 # usleep 1
1526 # echo 0 > tracing_enabled 1526 # echo 0 > tracing_on
1527 # cat trace 1527 # cat trace
1528# tracer: ftrace 1528# tracer: ftrace
1529# 1529#
@@ -1769,9 +1769,9 @@ different. The trace is live.
1769 # echo function > current_tracer 1769 # echo function > current_tracer
1770 # cat trace_pipe > /tmp/trace.out & 1770 # cat trace_pipe > /tmp/trace.out &
1771[1] 4153 1771[1] 4153
1772 # echo 1 > tracing_enabled 1772 # echo 1 > tracing_on
1773 # usleep 1 1773 # usleep 1
1774 # echo 0 > tracing_enabled 1774 # echo 0 > tracing_on
1775 # cat trace 1775 # cat trace
1776# tracer: function 1776# tracer: function
1777# 1777#
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index dc53ecb80589..8dc8da6733f9 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2710,6 +2710,10 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
2710 2710
2711 mutex_lock(&trace_types_lock); 2711 mutex_lock(&trace_types_lock);
2712 if (tracer_enabled ^ val) { 2712 if (tracer_enabled ^ val) {
2713
2714 /* Only need to warn if this is used to change the state */
2715 WARN_ONCE(1, "tracing_enabled is deprecated. Use tracing_on");
2716
2713 if (val) { 2717 if (val) {
2714 tracer_enabled = 1; 2718 tracer_enabled = 1;
2715 if (current_trace->start) 2719 if (current_trace->start)