aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2013-01-11 16:14:10 -0500
committerSteven Rostedt <rostedt@goodmis.org>2013-01-11 16:14:10 -0500
commit2df8f8a6a897ebf4c5613b5be6103d33b2a21520 (patch)
treea79d468ef6e2b41392dca68c9319f73a99a51770
parenta8dd2176a8e988e3744e863ac39647a6f59fa900 (diff)
tracing: Fix regression with irqsoff tracer and tracing_on file
Commit 02404baf1b47 "tracing: Remove deprecated tracing_enabled file" removed the tracing_enabled file as it never worked properly and the tracing_on file should be used instead. But the tracing_on file didn't call into the tracers start/stop routines like the tracing_enabled file did. This caused trace-cmd to break when it enabled the irqsoff tracer. If you just did "echo irqsoff > current_tracer" then it would work properly. But the tool trace-cmd disables tracing first by writing "0" into the tracing_on file. Then it writes "irqsoff" into current_tracer and then writes "1" into tracing_on. Unfortunately, the above commit changed the irqsoff tracer to check the tracing_on status instead of the tracing_enabled status. If it's disabled then it does not start the tracer internals. The problem is that writing "1" into tracing_on does not call the tracers "start" routine like writing "1" into tracing_enabled did. This makes the irqsoff tracer not start when using the trace-cmd tool, and is a regression for userspace. Simple fix is to have the tracing_on file call the tracers start() method when being enabled (and the stop() method when disabled). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/trace.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 1bbfa044650..f3ec1cfb0de 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4817,10 +4817,17 @@ rb_simple_write(struct file *filp, const char __user *ubuf,
4817 return ret; 4817 return ret;
4818 4818
4819 if (buffer) { 4819 if (buffer) {
4820 if (val) 4820 mutex_lock(&trace_types_lock);
4821 if (val) {
4821 ring_buffer_record_on(buffer); 4822 ring_buffer_record_on(buffer);
4822 else 4823 if (current_trace->start)
4824 current_trace->start(tr);
4825 } else {
4823 ring_buffer_record_off(buffer); 4826 ring_buffer_record_off(buffer);
4827 if (current_trace->stop)
4828 current_trace->stop(tr);
4829 }
4830 mutex_unlock(&trace_types_lock);
4824 } 4831 }
4825 4832
4826 (*ppos)++; 4833 (*ppos)++;