summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2024-11-17 21:26:38 -0800
committerNamhyung Kim <namhyung@kernel.org>2024-11-22 13:34:31 -0800
commitfc26637d70d3f1ba9df8cd0f7c22b8b331c564e7 (patch)
treed20d901c56d30ffa4ad449982eb0ddf74a8cf323
parent85c60a01b85ee956adf8d46c253fc50f75363e8f (diff)
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>
-rw-r--r--tools/perf/tests/hwmon_pmu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/tests/hwmon_pmu.c b/tools/perf/tests/hwmon_pmu.c
index 9f44093f18df..1e5f93aaaf5f 100644
--- a/tools/perf/tests/hwmon_pmu.c
+++ b/tools/perf/tests/hwmon_pmu.c
@@ -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) {