Skip to content

Commit

Permalink
perf intel-pt: Fix sync state when a PSB (synchronization) packet is …
Browse files Browse the repository at this point in the history
…found

commit ad106a2 upstream.

When syncing, it may be that branch packet generation is not enabled at
that point, in which case there will not immediately be a control-flow
packet, so some packets before a control flow packet turns up, get
ignored.  However, the decoder is in sync as soon as a PSB is found, so
the state should be set accordingly.

Fixes: f4aa081 ("perf tools: Add Intel PT decoder")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: stable@vger.kernel.org # v5.15+
Link: https://lore.kernel.org/r/20211210162303.2288710-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[Adrian: Backport to v5.10]
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Adrian Hunter authored and Greg Kroah-Hartman committed Dec 17, 2021
1 parent 731ff78 commit 3bb7fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,7 @@ static int intel_pt_sync(struct intel_pt_decoder *decoder)
return err;

decoder->have_last_ip = true;
decoder->pkt_state = INTEL_PT_STATE_NO_IP;
decoder->pkt_state = INTEL_PT_STATE_IN_SYNC;

err = intel_pt_walk_psb(decoder);
if (err)
Expand Down

0 comments on commit 3bb7fd4

Please sign in to comment.