perf intel-pt: Fix sync state when a PSB (synchronization) packet is found
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 13 Dec 2021 15:45:43 +0000 (17:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Dec 2021 09:14:41 +0000 (10:14 +0100)
commit3bb7fd4be8c47a4c562dfeac1ef62ad85c9e3149
tree44048e4189476d5c2699b632cb54eac5ca149c0a
parent731ff78841384877c7b36f78c8aafd60ed70ad3a
perf intel-pt: Fix sync state when a PSB (synchronization) packet is found

commit ad106a26aef3a95ac7ca88d033b431661ba346ce 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: f4aa081949e7b6 ("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>
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c