From e6ad1fb3458f9e77f63bcd555baf7a08008ecc2e Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 22 Jun 2026 18:27:46 -0700 Subject: perf parse-events: Restrict core PMU bypass to --cputype option Commit b1c5efbfd92e ("perf parse-events: Remove hard coded legacy hardware and cache parsing") introduced a bypass to PMU filtering to prevent uncore PMUs from being filtered out during event parsing, which was required for resolving `duration_time` and `uncore_freq` when running with `--cputype`. However, this bypass was active whenever `pmu_filter` was set, which also incorrectly bypassed filtering for the `--pmu-filter` option. Introduce a `cputype_filter` boolean flag in `parse_events_state` and `parse_events_option_args` to distinguish filtering initiated by `--cputype` from that initiated by `--pmu-filter`. Restrict the core-only check in `parse_events__filter_pmu()` to when `cputype_filter` is true. Fixes: b1c5efbfd92e ("perf parse-events: Remove hard coded legacy hardware and cache parsing") Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers Signed-off-by: Namhyung Kim --- tools/perf/util/python.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/perf/util/python.c') diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 11e1f39c1bea..af85c0771c44 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -3411,7 +3411,8 @@ static PyObject *pyrf__parse_metrics(PyObject *self, PyObject *args) ((struct pyrf_cpu_map *)pcpus)->cpus : NULL; perf_evlist__set_maps(evlist__core(evlist), cpus, threads); - ret = metricgroup__parse_groups(evlist, pmu ?: "all", input, + ret = metricgroup__parse_groups(evlist, pmu ?: "all", + /*cputype_filter=*/false, input, /*metric_no_group=*/ false, /*metric_no_merge=*/ false, /*metric_no_threshold=*/ true, -- cgit