Re: [RFC PATCH v1] perf parse-events: Make legacy events lower priority than sysfs/json

From: Arnaldo Carvalho de Melo
Date: Thu Nov 23 2023 - 16:39:05 EST


Em Thu, Nov 23, 2023 at 11:18:22AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Nov 23, 2023 at 05:45:19PM +0900, Hector Martin escreveu:
> > On 2023/11/23 13:29, Ian Rogers wrote:
> > > The bulk of this change is updating all of the parse-events test
> > > expectations so that if a sysfs/json event exists for a PMU the test
> > > doesn't fail - a further sign, if it were needed, that the legacy
> > > event priority was a known and tested behavior of the perf tool.
>
> > > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > > ---
> > > This is a large behavioral change:
> > > 1) the scope of the change means it should bake on linux-next and I
> > > don't believe should be a 6.7-rc fix.
> > > 2) a fixes tag and stable backport I don't think are appropriate. The
> > > real reported issue is with the PMU driver. A backport would bring the
> > > risk that later fixes, due to the large behavior change, wouldn't be
> > > backported and past releases get regressed in scenarios like
> > > hybrid. Backports for the perf tool are also less necessary than say a
> > > buggy PMU driver, as distributions should be updating to the latest
> > > perf tool regardless of what Linux kernel is being run (the perf tool
> > > is backward compatible).
> >
> > Tested-by: Hector Martin <marcan@xxxxxxxxx>
>
> Thanks, applied locally, doing some tests and then will push for
> linux-next to pick it up.
>
> Mark, can I have your Reviewed-by or Acked-by?

I'll collect those, but only after addressing these:

[perfbuilder@five ~]$ export BUILD_TARBALL=http://192.168.86.5/perf/perf-6.6.0-rc1.tar.xz
[perfbuilder@five ~]$ time dm
1 100.09 almalinux:8 : FAIL clang version 15.0.7 (Red Hat 15.0.7-1.module_el8.8.0+3466+dfcbc058)
util/parse-events.c:1461:6: error: variable 'alias_rewrote_terms' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]
if (!parse_state->fake_pmu && perf_pmu__check_alias(pmu, &parsed_terms,
^~~~~~~~~~~~~~~~~~~~~~
util/parse-events.c:1477:6: note: uninitialized use occurs here
if (alias_rewrote_terms &&
^~~~~~~~~~~~~~~~~~~
util/parse-events.c:1461:6: note: remove the '&&' if its condition is always true
if (!parse_state->fake_pmu && perf_pmu__check_alias(pmu, &parsed_terms,
^~~~~~~~~~~~~~~~~~~~~~~~~
util/parse-events.c:1401:26: note: initialize the variable 'alias_rewrote_terms' to silence this warning
bool alias_rewrote_terms;
^
= false
1 error generated.
make[3]: *** [/git/perf-6.6.0-rc1/tools/build/Makefile.build:158: util] Error 2
2 114.29 almalinux:9 : FAIL clang version 15.0.7 (Red Hat 15.0.7-2.el9)
util/parse-events.c:1461:6: error: variable 'alias_rewrote_terms' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]
if (!parse_state->fake_pmu && perf_pmu__check_alias(pmu, &parsed_terms,
^~~~~~~~~~~~~~~~~~~~~~
util/parse-events.c:1477:6: note: uninitialized use occurs here
if (alias_rewrote_terms &&
^~~~~~~~~~~~~~~~~~~
util/parse-events.c:1461:6: note: remove the '&&' if its condition is always true
if (!parse_state->fake_pmu && perf_pmu__check_alias(pmu, &parsed_terms,
^~~~~~~~~~~~~~~~~~~~~~~~~
util/parse-events.c:1401:26: note: initialize the variable 'alias_rewrote_terms' to silence this warning
bool alias_rewrote_terms;
^
= false
1 error generated.
make[3]: *** [/git/perf-6.6.0-rc1/tools/build/Makefile.build:158: util] Error 2