[PATCH v1 0/2] Consistently prioritize legacy events

From: Ian Rogers
Date: Mon Mar 10 2025 - 15:55:34 EST


Legacy events were historically the priority over sysfs/json
events. This behavior was changed in commit a24d9d9dc096 ("perf
parse-events: Make legacy events lower priority than sysfs/JSON") to
fix issues on ARM Apple-M CPUs. Sysfs/json being the priority makes
most sense, was preferred by RISC-V and gives abilities impossible
with legacy events. Making this encoding consistent is proving
impossible with endless bike shedding, people saying they see
something as a fix then when that fix is provided continuing to
object, etc. Given that in the RFC [1] legacy events are seen as being
preferrable let's just follow up on that and make their use
consistent.

If it isn't clear, I think this is the wrong decision and landing [2]
should be the priority. When I try to have this conversation it just
gets ignored and I want consistency more than my preferred
prioritization.

[1] https://lore.kernel.org/lkml/Z7Z5kv75BMML2A1q@xxxxxxxxxx/
[2] https://lore.kernel.org/linux-perf-users/20250109222109.567031-1-irogers@xxxxxxxxxx/

Ian Rogers (2):
perf parse-events: Make legacy events always have priority over
sysfs/json
Revert "perf evsel: Add alternate_hw_config and use in evsel__match"

tools/perf/builtin-diff.c | 6 +--
tools/perf/tests/parse-events.c | 13 ++----
tools/perf/util/evsel.c | 21 ---------
tools/perf/util/evsel.h | 19 +++++++-
tools/perf/util/parse-events.c | 81 ++++++++++++---------------------
tools/perf/util/parse-events.h | 8 +---
tools/perf/util/parse-events.y | 2 +-
tools/perf/util/pmu.c | 6 +--
tools/perf/util/pmu.h | 2 +-
9 files changed, 57 insertions(+), 101 deletions(-)

--
2.49.0.rc0.332.g42c0ae87b1-goog