]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf metricgroup: Fix metricgroup__has_metric_or_groups
authorIan Rogers <irogers@google.com>
Sat, 7 Feb 2026 00:49:56 +0000 (16:49 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 24 Feb 2026 17:52:08 +0000 (09:52 -0800)
Use metricgroup__for_each_metric rather than
pmu_metrics_table__for_each_metric that combines the default metric
table with, a potentially empty, CPUID table.

Fixes: cee275edcdb1 ("perf metricgroup: Don't early exit if no CPUID table exists")
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Tested-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/metricgroup.c

index 46bf4dfeebc8c181e86bfe5dcf3b3d316708d238..7e39d469111b2995f5a2636529d6985eac595f76 100644 (file)
@@ -1605,9 +1605,9 @@ bool metricgroup__has_metric_or_groups(const char *pmu, const char *metric_or_gr
                .metric_or_groups = metric_or_groups,
        };
 
-       return pmu_metrics_table__for_each_metric(table,
-                                                 metricgroup__has_metric_or_groups_callback,
-                                                 &data)
+       return metricgroup__for_each_metric(table,
+                                           metricgroup__has_metric_or_groups_callback,
+                                           &data)
                ? true : false;
 }