Commit cf30cf67 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

tracing: Add disable_on_free option

Add a trace option to disable tracing on free. When this option is
set, a write into the free_buffer file will not only shrink the
ring buffer down to zero, but it will also disable tracing.

Cc: Vaibhav Nagarnaik <vnagarnaik@google.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 4f271a2a
...@@ -425,6 +425,7 @@ static const char *trace_options[] = { ...@@ -425,6 +425,7 @@ static const char *trace_options[] = {
"graph-time", "graph-time",
"record-cmd", "record-cmd",
"overwrite", "overwrite",
"disable_on_free",
NULL NULL
}; };
...@@ -3518,8 +3519,9 @@ tracing_free_buffer_write(struct file *filp, const char __user *ubuf, ...@@ -3518,8 +3519,9 @@ tracing_free_buffer_write(struct file *filp, const char __user *ubuf,
static int static int
tracing_free_buffer_release(struct inode *inode, struct file *filp) tracing_free_buffer_release(struct inode *inode, struct file *filp)
{ {
/* disable tracing */ /* disable tracing ? */
tracing_off(); if (trace_flags & TRACE_ITER_STOP_ON_FREE)
tracing_off();
/* resize the ring buffer to 0 */ /* resize the ring buffer to 0 */
tracing_resize_ring_buffer(0); tracing_resize_ring_buffer(0);
......
...@@ -609,6 +609,7 @@ enum trace_iterator_flags { ...@@ -609,6 +609,7 @@ enum trace_iterator_flags {
TRACE_ITER_GRAPH_TIME = 0x80000, TRACE_ITER_GRAPH_TIME = 0x80000,
TRACE_ITER_RECORD_CMD = 0x100000, TRACE_ITER_RECORD_CMD = 0x100000,
TRACE_ITER_OVERWRITE = 0x200000, TRACE_ITER_OVERWRITE = 0x200000,
TRACE_ITER_STOP_ON_FREE = 0x400000,
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment