File perf-intel-pt-Fix-sync-state-when-a-PSB-synchronization-packet-is-found.patch of Package perf
40
1
From: Adrian Hunter <adrian.hunter@intel.com>
2
Date: Fri, 10 Dec 2021 18:22:58 +0200
3
Subject: perf intel-pt: Fix sync state when a PSB (synchronization) packet is
4
found
5
Git-commit: ad106a26aef3a95ac7ca88d033b431661ba346ce
6
Patch-mainline: v5.16-rc5
7
References: git-fixes
8
9
When syncing, it may be that branch packet generation is not enabled at
10
that point, in which case there will not immediately be a control-flow
11
packet, so some packets before a control flow packet turns up, get
12
ignored. However, the decoder is in sync as soon as a PSB is found, so
13
the state should be set accordingly.
14
15
Fixes: f4aa081949e7b6 ("perf tools: Add Intel PT decoder")
16
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
17
Cc: Jiri Olsa <jolsa@redhat.com>
18
Cc: stable@vger.kernel.org # v5.15+
19
Link: https://lore.kernel.org/r/20211210162303.2288710-3-adrian.hunter@intel.com
20
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
21
Signed-off-by: Tony Jones <tonyj@suse.de>
22
---
23
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 +-
24
1 file changed, 1 insertion(+), 1 deletion(-)
25
26
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
27
index 6f6f163161a9..bddf98123dc3 100644
28
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
29
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
30
31
}
32
33
decoder->have_last_ip = true;
34
- decoder->pkt_state = INTEL_PT_STATE_NO_IP;
35
+ decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;
36
37
err = intel_pt_walk_psb(decoder);
38
if (err)
39
40