aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-06-14 22:44:07 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-06-14 22:48:45 -0400
commitcf30cf67d6c7592c670ec946d89fc15ee0deb0eb (patch)
treef86ca612b255ee8570e2fd6198e066ea8cf33fe0 /kernel/trace
parent4f271a2a60c748599b30bb4dafff30d770439b96 (diff)
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: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace.c6
-rw-r--r--kernel/trace/trace.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9c557ae6a21e..42fdf3adff31 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -425,6 +425,7 @@ static const char *trace_options[] = {
425 "graph-time", 425 "graph-time",
426 "record-cmd", 426 "record-cmd",
427 "overwrite", 427 "overwrite",
428 "disable_on_free",
428 NULL 429 NULL
429}; 430};
430 431
@@ -3518,8 +3519,9 @@ tracing_free_buffer_write(struct file *filp, const char __user *ubuf,
3518static int 3519static int
3519tracing_free_buffer_release(struct inode *inode, struct file *filp) 3520tracing_free_buffer_release(struct inode *inode, struct file *filp)
3520{ 3521{
3521 /* disable tracing */ 3522 /* disable tracing ? */
3522 tracing_off(); 3523 if (trace_flags & TRACE_ITER_STOP_ON_FREE)
3524 tracing_off();
3523 /* resize the ring buffer to 0 */ 3525 /* resize the ring buffer to 0 */
3524 tracing_resize_ring_buffer(0); 3526 tracing_resize_ring_buffer(0);
3525 3527
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 229f8591f61d..742f545ae185 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -609,6 +609,7 @@ enum trace_iterator_flags {
609 TRACE_ITER_GRAPH_TIME = 0x80000, 609 TRACE_ITER_GRAPH_TIME = 0x80000,
610 TRACE_ITER_RECORD_CMD = 0x100000, 610 TRACE_ITER_RECORD_CMD = 0x100000,
611 TRACE_ITER_OVERWRITE = 0x200000, 611 TRACE_ITER_OVERWRITE = 0x200000,
612 TRACE_ITER_STOP_ON_FREE = 0x400000,
612}; 613};
613 614
614/* 615/*