Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88645cf3 authored by Baohong Liu's avatar Baohong Liu Committed by Greg Kroah-Hartman
Browse files

tracing: Apply trace_clock changes to instance max buffer

commit 170b3b1050e28d1ba0700e262f0899ffa4fccc52 upstream.

Currently trace_clock timestamps are applied to both regular and max
buffers only for global trace. For instance trace, trace_clock
timestamps are applied only to regular buffer. But, regular and max
buffers can be swapped, for example, following a snapshot. So, for
instance trace, bad timestamps can be seen following a snapshot.
Let's apply trace_clock timestamps to instance max buffer as well.

Link: http://lkml.kernel.org/r/ebdb168d0be042dcdf51f81e696b17fabe3609c1.1504642143.git.tom.zanussi@linux.intel.com



Fixes: 277ba044 ("tracing: Add interface to allow multiple trace buffers")
Signed-off-by: default avatarBaohong Liu <baohong.liu@intel.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 45a521cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4966,7 +4966,7 @@ static int tracing_set_clock(struct trace_array *tr, const char *clockstr)
	tracing_reset_online_cpus(&tr->trace_buffer);
	tracing_reset_online_cpus(&tr->trace_buffer);


#ifdef CONFIG_TRACER_MAX_TRACE
#ifdef CONFIG_TRACER_MAX_TRACE
	if (tr->flags & TRACE_ARRAY_FL_GLOBAL && tr->max_buffer.buffer)
	if (tr->max_buffer.buffer)
		ring_buffer_set_clock(tr->max_buffer.buffer, trace_clocks[i].func);
		ring_buffer_set_clock(tr->max_buffer.buffer, trace_clocks[i].func);
	tracing_reset_online_cpus(&tr->max_buffer);
	tracing_reset_online_cpus(&tr->max_buffer);
#endif
#endif