Re: [PATCH v2] perf pmu: Skip test on Arm64 when #slots is zero

From: Arnaldo Carvalho de Melo

Date: Fri May 15 2026 - 07:56:40 EST


On Wed, May 13, 2026 at 03:37:05PM +0100, Leo Yan wrote:
> On Wed, May 13, 2026 at 06:10:00AM -0700, Ian Rogers wrote:
>
> [...]
>
> > We get this failure for these metrics on x86 when building perf with
> > JEVENTS_ARCH=all. Rather than expecting the parse failure perhaps we
> > should just always return true in tool_pmu__read_event:
> > https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/tool_pmu.c#n421
>
> I considered returning true when slots == 0 so can mute parser error
> and allow the test to pass. However, if so platforms which do not
> support #slots would be able to use those metrics and generate
> meaningless statistics.
>
> I would keep the parser errors so this is a reminding when users wrongly
> use unsupported metrics.
>
> > I guess the problem there is that when these metrics are broken (no
> > slots value) you can't distinguish this case from other valid cases.
>
> IMO, this is a test design issue: tests should validate metrics while
> remaining hardware-agnostic. Hardware-specific cases should either run
> only on supported platforms, or the tests should be refined to run
> transparently across different hardware.
>
> > Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
>
> Thanks for review!

Thanks, applied to perf-tools-next, for v7.2.

- Arnaldo