Re: [PATCH v2 06/18] perf s390 s390_cpumcfdg_dump: Don't scan all PMUs

From: Ian Rogers
Date: Sat Aug 26 2023 - 02:31:31 EST


On Fri, Aug 25, 2023 at 6:38 PM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Fri, Aug 25, 2023 at 03:56:54PM -0700, Ian Rogers escreveu:
> > On Fri, Aug 25, 2023 at 1:56 PM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > > [root@kernelqe3 linux]# git bisect bad
> > > 2e255b4f9f41f137d9e3dc4fae3603a9c2c3dd28 is the first bad commit
> > > commit 2e255b4f9f41f137d9e3dc4fae3603a9c2c3dd28
> > > Author: Ian Rogers <irogers@xxxxxxxxxx>
> > > Date: Wed Aug 23 21:13:16 2023 -0700
> > >
> > > perf jevents: Group events by PMU
> > >
> > > Prior to this change a cpuid would map to a list of events where the PMU
> > > would be encoded alongside the event information. This change breaks
> > > apart each group of events so that there is a group per PMU. A new table
> > > is added with the PMU's name and the list of events, the original table
> > > now holding an array of these per PMU tables.
> > >
> > > These changes are to make it easier to get per PMU information about
> > > events, rather than the current approach of scanning all events. The
> > > perf binary size with BPF skeletons on x86 is reduced by about 1%. The
> > > unidentified PMU is now always expanded to "cpu".
> > >
> > > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > > Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> > > Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> > > Cc: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
> > > Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> > > Cc: James Clark <james.clark@xxxxxxx>
> > > Cc: Jing Zhang <renyu.zj@xxxxxxxxxxxxxxxxx>
> > > Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> > > Cc: John Garry <john.g.garry@xxxxxxxxxx>
> > > Cc: Kajol Jain <kjain@xxxxxxxxxxxxx>
> > > Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> > > Cc: Mark Rutland <mark.rutland@xxxxxxx>
> > > Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> > > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > > Cc: Ravi Bangoria <ravi.bangoria@xxxxxxx>
> > > Cc: Rob Herring <robh@xxxxxxxxxx>
> > > Link: https://lore.kernel.org/r/20230824041330.266337-5-irogers@xxxxxxxxxx
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > >
> > > tools/perf/pmu-events/jevents.py | 181 +++++++++++++++++++++++++++++----------
> > > tools/perf/tests/pmu-events.c | 30 ++++---
> > > 2 files changed, 154 insertions(+), 57 deletions(-)
> > > [root@kernelqe3 linux]#
> >
> > This change defaulted events without a specified PMU to being for the
> > PMU 'cpu', so that events in pmu-events.c were associated with a PMU
> > and we could find per-PMU information easily. The test events have no
> > PMU and so this has broken s390 where the the PMU should be "cpum_cf".
> > It has probably also broken x86 hybrid and arm where their default PMU
> > isn't cpu. I'll work on a fix, but the problem will be limited to the
> > test.
>
> Ok, please use tmp.perf-tools-next as the basis for your work, that is
> what I have right now.

Thanks. I repro-ed the PMU events failure on alderlake and the patch I sent:
https://lore.kernel.org/lkml/20230826062203.1058041-1-irogers@xxxxxxxxxx/
addressed it. I didn't repro the sysfs issue and so it may be resolved
by this too, but it may be a different issue. There may also be more
issues specific to s390. I'm hopeful the patch fixes them but please
give it a go.

Thanks,
Ian

> - Arnaldo