aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-08-31 22:32:27 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-09-04 11:52:24 -0400
commitb8de7bd168fa54d059b16d3057b2f8a32cc5bdc3 (patch)
tree3455ec59050f7f6d466a8c08275567079914d1b1 /kernel/trace/trace.c
parent8248ac052dfd1eb41819fbc0ca5c7a1667e7e70c (diff)
tracing: disable update max tracer while reading trace
When reading the tracer from the trace file, updating the max latency may corrupt the output. This patch disables the tracing of the max latency while reading the trace file. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index df2c9f730ac6..e521f1e8f2bb 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -263,6 +263,9 @@ unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK |
263 TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | TRACE_ITER_SLEEP_TIME | 263 TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | TRACE_ITER_SLEEP_TIME |
264 TRACE_ITER_GRAPH_TIME; 264 TRACE_ITER_GRAPH_TIME;
265 265
266static int trace_stop_count;
267static DEFINE_SPINLOCK(tracing_start_lock);
268
266/** 269/**
267 * trace_wake_up - wake up tasks waiting for trace input 270 * trace_wake_up - wake up tasks waiting for trace input
268 * 271 *
@@ -442,6 +445,9 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
442{ 445{
443 struct ring_buffer *buf = tr->buffer; 446 struct ring_buffer *buf = tr->buffer;
444 447
448 if (trace_stop_count)
449 return;
450
445 WARN_ON_ONCE(!irqs_disabled()); 451 WARN_ON_ONCE(!irqs_disabled());
446 __raw_spin_lock(&ftrace_max_lock); 452 __raw_spin_lock(&ftrace_max_lock);
447 453
@@ -469,6 +475,9 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu)
469{ 475{
470 int ret; 476 int ret;
471 477
478 if (trace_stop_count)
479 return;
480
472 WARN_ON_ONCE(!irqs_disabled()); 481 WARN_ON_ONCE(!irqs_disabled());
473 __raw_spin_lock(&ftrace_max_lock); 482 __raw_spin_lock(&ftrace_max_lock);
474 483
@@ -685,9 +694,6 @@ static void trace_init_cmdlines(void)
685 cmdline_idx = 0; 694 cmdline_idx = 0;
686} 695}
687 696
688static int trace_stop_count;
689static DEFINE_SPINLOCK(tracing_start_lock);
690
691/** 697/**
692 * ftrace_off_permanent - disable all ftrace code permanently 698 * ftrace_off_permanent - disable all ftrace code permanently
693 * 699 *