Skip to contentSkip to conversation

perf test: Correct hwmon test PMU detection

PATCH Applied Ian Rogers 2 participants 2 messages Nov 18, 2024 – Nov 22, 2024 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf test: Correct hwmon test PMU detection

Use name to avoid potential other hwmon PMUs.

---
 tools/perf/tests/hwmon_pmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/tests/hwmon_pmu.c +2 -1
index 9f44093f18df..1e5f93aaaf5f 100644
@@ -173,7 +173,8 @@ static int do_test(size_t i, bool with_pmu, bool with_alias)
 	}
 
 	evlist__for_each_entry(evlist, evsel) {
-		if (!perf_pmu__is_hwmon(evsel->pmu))
+		if (!evsel->pmu || !evsel->pmu->name ||
+		    strcmp(evsel->pmu->name, "hwmon_a_test_hwmon_pmu"))
 			continue;
 
 		if (evsel->core.attr.config != (u64)test_events[i].config) {
Signature · 1 line
2.47.0.338.g60cca15819-goog
maintainer Applied
#1 lore raw
Quoted 3 lines · Ian Rogers

Use name to avoid potential other hwmon PMUs.

Applied to perf-tools-next, thanks!

Best regards,
Namhyung