diff options
-rw-r--r-- | kernel/trace/trace.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 1bbfa04..f3ec1cf 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, return ret; if (buffer) { - if (val) + mutex_lock(&trace_types_lock); + if (val) { ring_buffer_record_on(buffer); - else + if (current_trace->start) + current_trace->start(tr); + } else { ring_buffer_record_off(buffer); + if (current_trace->stop) + current_trace->stop(tr); + } + mutex_unlock(&trace_types_lock); } (*ppos)++; |