Skip to content

Commit fc26637

Browse files
captain5050namhyung
authored andcommitted
perf test: Correct hwmon test PMU detection
Use name to avoid potential other hwmon PMUs. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20241118052638.754981-1-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
1 parent 85c60a0 commit fc26637

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/perf/tests/hwmon_pmu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ static int do_test(size_t i, bool with_pmu, bool with_alias)
173173
}
174174

175175
evlist__for_each_entry(evlist, evsel) {
176-
if (!perf_pmu__is_hwmon(evsel->pmu))
176+
if (!evsel->pmu || !evsel->pmu->name ||
177+
strcmp(evsel->pmu->name, "hwmon_a_test_hwmon_pmu"))
177178
continue;
178179

179180
if (evsel->core.attr.config != (u64)test_events[i].config) {

0 commit comments

Comments
 (0)