Commit 4c901675 authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware) Committed by Greg Kroah-Hartman

tracing: Do not call start/stop() functions when tracing_on does not change

commit f143641b upstream.

Currently, when one echo's in 1 into tracing_on, the current tracer's
"start()" function is executed, even if tracing_on was already one. This can
lead to strange side effects. One being that if the hwlat tracer is enabled,
and someone does "echo 1 > tracing_on" into tracing_on, the hwlat tracer's
start() function is called again which will recreate another kernel thread,
and make it unable to remove the old one.


Fixes: 2df8f8a6 ("tracing: Fix regression with irqsoff tracer and tracing_on file")
Reported-by: default avatarErica Bugden <>
Signed-off-by: default avatarSteven Rostedt (VMware) <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 2b4c940d
......@@ -7545,7 +7545,9 @@ rb_simple_write(struct file *filp, const char __user *ubuf,
if (buffer) {
if (val) {
if (!!val == tracer_tracing_is_on(tr)) {
val = 0; /* do nothing */
} else if (val) {
if (tr->current_trace->start)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment