perf arm-spe: Only warn once for each unsupported address packet
authorRob Herring <robh@kernel.org>
Fri, 27 Jan 2023 20:55:46 +0000 (14:55 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Feb 2023 19:32:19 +0000 (16:32 -0300)
Unknown address packet indexes are not an error as the Arm architecture
can (and has with SPEv1.2) define new ones and implementation defined
ones are also allowed. The error message for every occurrence of the
packet is needlessly noisy as well. Change the message to print just
once for each unknown index.

Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20230127205546.667740-1-robh@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/arm-spe-decoder/arm-spe-decoder.c

index 091987d..40dcedf 100644 (file)
@@ -68,7 +68,11 @@ static u64 arm_spe_calc_ip(int index, u64 payload)
                /* Clean highest byte */
                payload = SPE_ADDR_PKT_ADDR_GET_BYTES_0_6(payload);
        } else {
-               pr_err("unsupported address packet index: 0x%x\n", index);
+               static u32 seen_idx = 0;
+               if (!(seen_idx & BIT(index))) {
+                       seen_idx |= BIT(index);
+                       pr_warning("ignoring unsupported address packet index: 0x%x\n", index);
+               }
        }
 
        return payload;