]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.8.5/perf-intel-pt-fix-estimated-timestamps-for-cycle-accurate-mode.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.8.5 / perf-intel-pt-fix-estimated-timestamps-for-cycle-accurate-mode.patch
1 From 51ee6481fa8e879cc942bcc1b0af713e158b7a98 Mon Sep 17 00:00:00 2001
2 From: Adrian Hunter <adrian.hunter@intel.com>
3 Date: Wed, 28 Sep 2016 14:41:35 +0300
4 Subject: perf intel-pt: Fix estimated timestamps for cycle-accurate mode
5
6 From: Adrian Hunter <adrian.hunter@intel.com>
7
8 commit 51ee6481fa8e879cc942bcc1b0af713e158b7a98 upstream.
9
10 In cycle-accurate mode, timestamps can be calculated from CYC packets.
11 The decoder also estimates timestamps based on the number of
12 instructions since the last timestamp. For that to work in
13 cycle-accurate mode, the instruction count needs to be reset to zero
14 when a timestamp is calculated from a CYC packet, but that wasn't
15 happening, so fix it.
16
17 Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
18 Cc: Jiri Olsa <jolsa@redhat.com>
19 Link: http://lkml.kernel.org/r/1475062896-22274-1-git-send-email-adrian.hunter@intel.com
20 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23 ---
24 tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 ++
25 1 file changed, 2 insertions(+)
26
27 --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
28 +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
29 @@ -1323,6 +1323,8 @@ static void intel_pt_calc_cyc_timestamp(
30 timestamp, decoder->timestamp);
31 else
32 decoder->timestamp = timestamp;
33 +
34 + decoder->timestamp_insn_cnt = 0;
35 }
36
37 /* Walk PSB+ packets when already in sync. */