Skip to content

Commit da7f84c

Browse files
Viktor Rosendahlrostedt
authored andcommitted
tracing: Use pause-on-trace with the latency tracers
Eaerlier, tracing was disabled when reading the trace file. This behavior was changed with: commit 06e0a54 ("tracing: Do not disable tracing when reading the trace file"). This doesn't seem to work with the latency tracers. The above mentioned commit dit not only change the behavior but also added an option to emulate the old behavior. The idea with this patch is to enable this pause-on-trace option when the latency tracers are used. Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] Fixes: 06e0a54 ("tracing: Do not disable tracing when reading the trace file") Signed-off-by: Viktor Rosendahl <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 7e0a922 commit da7f84c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/trace/trace_irqsoff.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ static int __irqsoff_tracer_init(struct trace_array *tr)
562562
/* non overwrite screws up the latency tracers */
563563
set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1);
564564
set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, 1);
565+
/* without pause, we will produce garbage if another latency occurs */
566+
set_tracer_flag(tr, TRACE_ITER_PAUSE_ON_TRACE, 1);
565567

566568
tr->max_latency = 0;
567569
irqsoff_trace = tr;
@@ -583,11 +585,13 @@ static void __irqsoff_tracer_reset(struct trace_array *tr)
583585
{
584586
int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT;
585587
int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE;
588+
int pause_flag = save_flags & TRACE_ITER_PAUSE_ON_TRACE;
586589

587590
stop_irqsoff_tracer(tr, is_graph(tr));
588591

589592
set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, lat_flag);
590593
set_tracer_flag(tr, TRACE_ITER_OVERWRITE, overwrite_flag);
594+
set_tracer_flag(tr, TRACE_ITER_PAUSE_ON_TRACE, pause_flag);
591595
ftrace_reset_array_ops(tr);
592596

593597
irqsoff_busy = false;

0 commit comments

Comments
 (0)