Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ian Rogers and committed by
Namhyung Kim
fc26637d 85c60a01

+2 -1
+2 -1
tools/perf/tests/hwmon_pmu.c
··· 173 173 } 174 174 175 175 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")) 177 178 continue; 178 179 179 180 if (evsel->core.attr.config != (u64)test_events[i].config) {