Skip to content

Commit 406089d

Browse files
committed
Merge tag 'trace-3.8-rc3-regression-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing regression fixes from Steven Rostedt: "The clean up patch commit 0fb9656 "tracing: Make tracing_enabled be equal to tracing_on" caused two regressions. 1) The irqs off latency tracer no longer starts if tracing_on is off when the tracer is set, and then tracing_on is enabled. The tracing_on file needs the hook that tracing_enabled had to enable tracers if they request it (call the tracer's start() method). 2) That commit had a separate change that really should have been a separate patch, but it must have been added accidently with the -a option of git commit. But as the change is still related to the commit it wasn't noticed in review. That change, changed the way blocking is done by the trace_pipe file with respect to the tracing_on settings. I've been told that this change breaks current userspace, and this specific change is being reverted." * tag 'trace-3.8-rc3-regression-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix regression of trace_pipe tracing: Fix regression with irqsoff tracer and tracing_on file
2 parents 7dea1ff + 250bfd3 commit 406089d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

kernel/trace/trace.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,15 +3454,15 @@ static int tracing_wait_pipe(struct file *filp)
34543454
return -EINTR;
34553455

34563456
/*
3457-
* We block until we read something and tracing is enabled.
3457+
* We block until we read something and tracing is disabled.
34583458
* We still block if tracing is disabled, but we have never
34593459
* read anything. This allows a user to cat this file, and
34603460
* then enable tracing. But after we have read something,
34613461
* we give an EOF when tracing is again disabled.
34623462
*
34633463
* iter->pos will be 0 if we haven't read anything.
34643464
*/
3465-
if (tracing_is_enabled() && iter->pos)
3465+
if (!tracing_is_enabled() && iter->pos)
34663466
break;
34673467
}
34683468

@@ -4817,10 +4817,17 @@ rb_simple_write(struct file *filp, const char __user *ubuf,
48174817
return ret;
48184818

48194819
if (buffer) {
4820-
if (val)
4820+
mutex_lock(&trace_types_lock);
4821+
if (val) {
48214822
ring_buffer_record_on(buffer);
4822-
else
4823+
if (current_trace->start)
4824+
current_trace->start(tr);
4825+
} else {
48234826
ring_buffer_record_off(buffer);
4827+
if (current_trace->stop)
4828+
current_trace->stop(tr);
4829+
}
4830+
mutex_unlock(&trace_types_lock);
48244831
}
48254832

48264833
(*ppos)++;

0 commit comments

Comments
 (0)