Re: [PATCH v5 4/4] perf parse-events: Reapply "Prefer sysfs/JSON hardware events over legacy"

From: Namhyung Kim
Date: Tue Feb 04 2025 - 20:58:17 EST


On Mon, Feb 03, 2025 at 04:41:11PM -0800, Ian Rogers wrote:
> On Mon, Feb 3, 2025 at 4:15 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> [snip]
> > Yep, I agree it's confusing. So my opinion is to use legacy encoding
> > and no default wildcard. :)
>
> Making it so that all non-legacy, non-core PMU events require a PMU is
> a breaking change and a regression for all users, command line event
> name suggesting, any tool built off of perf, and so on. Breaking all
> perf users and requiring all perf metrics be rewritten is well..
> something..

Well, I guess the majority of users don't use non-core PMU events. And
we used to have PMU prefix on those events for years so old users should
not be affected. Actually perf list shows them with PMU prefix so I
think new users are also expected to use the PMU name.

$ perf list pmu
...
cstate_pkg/c2-residency/ [Kernel PMU event]
...
i915/actual-frequency/ [Kernel PMU event]
i915/bcs0-busy/ [Kernel PMU event]
...
msr/tsc/ [Kernel PMU event]
...
power/energy-cores/ [Kernel PMU event]
...
uncore_clock/clockticks/ [Kernel PMU event]
uncore_imc_free_running/data_read/ [Kernel PMU event]
...

The exception is the JSON events like below.

uncore interconnect:
unc_arb_coh_trk_requests.all
[UNC_ARB_COH_TRK_REQUESTS.ALL. Unit: uncore_arb]

which I hoped to be 'uncore_arb/unc_arb_coh_trk_requests.all/' or even
'uncore_arb/coh_trk_requests.all/'. But it would be hard to change the
all metric expressions now. Also users can directly use them as they
are listed by `perf list`. So we need to support that without PMUs.

Thanks,
Namhyung