From: Steven Rostedt (Red Hat) Date: Thu, 14 Mar 2013 18:20:54 +0000 (-0400) Subject: tracing: Keep overwrite in sync between regular and snapshot buffers X-Git-Tag: v3.8.5~58 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bfd57f5c82892a0202eca29d9f609e30b9090c8c;p=users%2Fjedix%2Flinux-maple.git tracing: Keep overwrite in sync between regular and snapshot buffers commit 80902822658aab18330569587cdb69ac1dfdcea8 upstream. 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. Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 744f2d4f2a7e..2ffbc2407bf9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2850,8 +2850,12 @@ static void set_tracer_flags(unsigned int mask, int enabled) if (mask == TRACE_ITER_RECORD_CMD) trace_event_enable_cmd_record(enabled); - if (mask == TRACE_ITER_OVERWRITE) + if (mask == TRACE_ITER_OVERWRITE) { ring_buffer_change_overwrite(global_trace.buffer, enabled); +#ifdef CONFIG_TRACER_MAX_TRACE + ring_buffer_change_overwrite(max_tr.buffer, enabled); +#endif + } if (mask == TRACE_ITER_PRINTK) trace_printk_start_stop_comm(enabled);