Skip to contentSkip to conversation

perf pmu: Correct auto_merge_stats test

PATCH Applied Ian Rogers 2 participants 3 messages Jun 26, 2023 – Jun 27, 2023 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf pmu: Correct auto_merge_stats test

The original logic was:
https://lore.kernel.org/all/[email protected]/
return !is_pmu_hybrid(pmu->name)

is_pmu_hybrid was removed but with the incorrect condition which was fixed for core PMUs but not uncore. This change fixes both.

Fixes e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid")
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -1
index 64fa568a5426..8d5ecd4ff1a9 100644
@@ -1427,7 +1427,7 @@ bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
 
 bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu)
 {
-	return pmu->is_core && perf_pmus__num_core_pmus() == 1;
+	return !pmu->is_core || perf_pmus__num_core_pmus() == 1;
 }
 
 bool perf_pmu__have_event(const struct perf_pmu *pmu, const char *name)
Signature · 1 line
2.41.0.162.gfafddb0af9-goog
maintainer Tested-by on v1 1/1
#1 lore raw

Hi Ian,

Quoted 10 lines · Ian Rogers

The original logic was:
https://lore.kernel.org/all/[email protected]/
return !is_pmu_hybrid(pmu->name)

is_pmu_hybrid was removed but with the incorrect condition which was fixed for core PMUs but not uncore. This change fixes both.

Fixes e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid")

Thanks,
Namhyung

Quoted 20 lines
---
 tools/perf/util/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/pmu.c +1 -2
index 64fa568a5426..8d5ecd4ff1a9 100644
@@ -1427,7 +1427,7 @@ bool perf_pmu__supports_legacy_cache(const struct perf_pmu *pmu)
 
 bool perf_pmu__auto_merge_stats(const struct perf_pmu *pmu)
 {
-       return pmu->is_core && perf_pmus__num_core_pmus() == 1;
+       return !pmu->is_core || perf_pmus__num_core_pmus() == 1;
 }
 
 bool perf_pmu__have_event(const struct perf_pmu *pmu, const char *name)
--

2.41.0.162.gfafddb0af9-goog

maintainer Applied
#2 lore raw
Quoted 9 lines · Namhyung Kim

Hi Ian,

Quoted 5 lines · Ian Rogers

The original logic was:
https://lore.kernel.org/all/[email protected]/
return !is_pmu_hybrid(pmu->name)

Quoted 7 lines
Quoted 5 lines

is_pmu_hybrid was removed but with the incorrect condition which was fixed for core PMUs but not uncore. This change fixes both.

Fixes e23421426e13 ("perf pmu: Correct perf_pmu__auto_merge_stats() affecting hybrid")

Applied to perf-tools-next, thanks!