Skip to content

Commit 8090282

Browse files
committed
tracing: Keep overwrite in sync between regular and snapshot buffers
Changing the overwrite mode for the ring buffer via the trace option only sets the normal buffer. But the snapshot buffer could swap with it, and then the snapshot would be in non overwrite mode and the normal buffer would be in overwrite mode, even though the option flag states otherwise. Keep the two buffers overwrite modes in sync. Cc: stable@vger.kernel.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 69d34da commit 8090282

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎kernel/trace/trace.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2895,8 +2895,12 @@ static void set_tracer_flags(unsigned int mask, int enabled)
28952895
if (mask == TRACE_ITER_RECORD_CMD)
28962896
trace_event_enable_cmd_record(enabled);
28972897

2898-
if (mask == TRACE_ITER_OVERWRITE)
2898+
if (mask == TRACE_ITER_OVERWRITE) {
28992899
ring_buffer_change_overwrite(global_trace.buffer, enabled);
2900+
#ifdef CONFIG_TRACER_MAX_TRACE
2901+
ring_buffer_change_overwrite(max_tr.buffer, enabled);
2902+
#endif
2903+
}
29002904

29012905
if (mask == TRACE_ITER_PRINTK)
29022906
trace_printk_start_stop_comm(enabled);

0 commit comments

Comments
 (0)