]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.52/tracing-apply-trace_clock-changes-to-instance-max-buffer.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.52 / tracing-apply-trace_clock-changes-to-instance-max-buffer.patch
1 From 170b3b1050e28d1ba0700e262f0899ffa4fccc52 Mon Sep 17 00:00:00 2001
2 From: Baohong Liu <baohong.liu@intel.com>
3 Date: Tue, 5 Sep 2017 16:57:19 -0500
4 Subject: tracing: Apply trace_clock changes to instance max buffer
5
6 From: Baohong Liu <baohong.liu@intel.com>
7
8 commit 170b3b1050e28d1ba0700e262f0899ffa4fccc52 upstream.
9
10 Currently trace_clock timestamps are applied to both regular and max
11 buffers only for global trace. For instance trace, trace_clock
12 timestamps are applied only to regular buffer. But, regular and max
13 buffers can be swapped, for example, following a snapshot. So, for
14 instance trace, bad timestamps can be seen following a snapshot.
15 Let's apply trace_clock timestamps to instance max buffer as well.
16
17 Link: http://lkml.kernel.org/r/ebdb168d0be042dcdf51f81e696b17fabe3609c1.1504642143.git.tom.zanussi@linux.intel.com
18
19 Fixes: 277ba0446 ("tracing: Add interface to allow multiple trace buffers")
20 Signed-off-by: Baohong Liu <baohong.liu@intel.com>
21 Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 kernel/trace/trace.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28 --- a/kernel/trace/trace.c
29 +++ b/kernel/trace/trace.c
30 @@ -5664,7 +5664,7 @@ static int tracing_set_clock(struct trac
31 tracing_reset_online_cpus(&tr->trace_buffer);
32
33 #ifdef CONFIG_TRACER_MAX_TRACE
34 - if (tr->flags & TRACE_ARRAY_FL_GLOBAL && tr->max_buffer.buffer)
35 + if (tr->max_buffer.buffer)
36 ring_buffer_set_clock(tr->max_buffer.buffer, trace_clocks[i].func);
37 tracing_reset_online_cpus(&tr->max_buffer);
38 #endif