tracing: Add an option for disabling markers
authorMandeep Singh Baines <mandeep.baines@gmail.com>
Sat, 8 Sep 2012 01:12:19 +0000 (18:12 -0700)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 24 Sep 2012 18:10:44 +0000 (14:10 -0400)
In our application, we have trace markers spread through user-space.
We have markers in GL, X, etc. These are super handy for Chrome's
about:tracing feature (Chrome + system + kernel trace view), but
can be very distracting when you're trying to debug a kernel issue.

I normally, use "grep -v tracing_mark_write" but it would be nice
if I could just temporarily disable markers all together.

Link: http://lkml.kernel.org/r/1347066739-26285-1-git-send-email-msb@chromium.org
CC: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c
kernel/trace/trace.h

index 08acf42e325b1276fe54205a3f42f656a0b6fe9d..1ec5c1dab6295d921f7c7763f799fbca5e71bc60 100644 (file)
@@ -328,7 +328,7 @@ static DECLARE_WAIT_QUEUE_HEAD(trace_wait);
 unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK |
        TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | TRACE_ITER_SLEEP_TIME |
        TRACE_ITER_GRAPH_TIME | TRACE_ITER_RECORD_CMD | TRACE_ITER_OVERWRITE |
-       TRACE_ITER_IRQ_INFO;
+       TRACE_ITER_IRQ_INFO | TRACE_ITER_MARKERS;
 
 static int trace_stop_count;
 static DEFINE_RAW_SPINLOCK(tracing_start_lock);
@@ -470,6 +470,7 @@ static const char *trace_options[] = {
        "overwrite",
        "disable_on_free",
        "irq-info",
+       "markers",
        NULL
 };
 
@@ -3886,6 +3887,9 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
        if (tracing_disabled)
                return -EINVAL;
 
+       if (!(trace_flags & TRACE_ITER_MARKERS))
+               return -EINVAL;
+
        if (cnt > TRACE_BUF_SIZE)
                cnt = TRACE_BUF_SIZE;
 
index 593debefc4e9218362840f015f5038f861379626..63a2da0b9a6edf0881cc6f536b014daf11b8ab70 100644 (file)
@@ -680,6 +680,7 @@ enum trace_iterator_flags {
        TRACE_ITER_OVERWRITE            = 0x200000,
        TRACE_ITER_STOP_ON_FREE         = 0x400000,
        TRACE_ITER_IRQ_INFO             = 0x800000,
+       TRACE_ITER_MARKERS              = 0x1000000,
 };
 
 /*