Skip to content

Commit 19684e9

Browse files
stkidacmel
authored andcommitted
perf: arm-spe: Fix check error when synthesizing events
In arm_spe_read_record(), when we are processing an events packet, 'decoder->packet.index' is the length of payload, which has been transformed in payloadlen(). So correct the check of 'idx'. Signed-off-by: Wei Li <liwei391@huawei.com> Reviewed-by: Leo Yan <leo.yan@linaro.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Hanjun Guo <guohanjun@huawei.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200724072628.35904-1-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 783abbd commit 19684e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/perf/util/arm-spe-decoder/arm-spe-decoder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)
182182
if (payload & BIT(EV_TLB_ACCESS))
183183
decoder->record.type |= ARM_SPE_TLB_ACCESS;
184184

185-
if ((idx == 1 || idx == 2 || idx == 3) &&
185+
if ((idx == 2 || idx == 4 || idx == 8) &&
186186
(payload & BIT(EV_LLC_MISS)))
187187
decoder->record.type |= ARM_SPE_LLC_MISS;
188188

189-
if ((idx == 1 || idx == 2 || idx == 3) &&
189+
if ((idx == 2 || idx == 4 || idx == 8) &&
190190
(payload & BIT(EV_LLC_ACCESS)))
191191
decoder->record.type |= ARM_SPE_LLC_ACCESS;
192192

193-
if ((idx == 1 || idx == 2 || idx == 3) &&
193+
if ((idx == 2 || idx == 4 || idx == 8) &&
194194
(payload & BIT(EV_REMOTE_ACCESS)))
195195
decoder->record.type |= ARM_SPE_REMOTE_ACCESS;
196196

0 commit comments

Comments
 (0)