]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - 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
CommitLineData
71fe0565
GKH
1From 51ee6481fa8e879cc942bcc1b0af713e158b7a98 Mon Sep 17 00:00:00 2001
2From: Adrian Hunter <adrian.hunter@intel.com>
3Date: Wed, 28 Sep 2016 14:41:35 +0300
4Subject: perf intel-pt: Fix estimated timestamps for cycle-accurate mode
5
6From: Adrian Hunter <adrian.hunter@intel.com>
7
8commit 51ee6481fa8e879cc942bcc1b0af713e158b7a98 upstream.
9
10In cycle-accurate mode, timestamps can be calculated from CYC packets.
11The decoder also estimates timestamps based on the number of
12instructions since the last timestamp. For that to work in
13cycle-accurate mode, the instruction count needs to be reset to zero
14when a timestamp is calculated from a CYC packet, but that wasn't
15happening, so fix it.
16
17Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
18Cc: Jiri Olsa <jolsa@redhat.com>
19Link: http://lkml.kernel.org/r/1475062896-22274-1-git-send-email-adrian.hunter@intel.com
20Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
21Signed-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. */