xref: /openbmc/linux/tools/perf/arch/arm64/util/pmu.c (revision a531b0c2)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include "../../../util/cpumap.h"
4 #include "../../../util/pmu.h"
5 
6 const struct pmu_events_map *pmu_events_map__find(void)
7 {
8 	struct perf_pmu *pmu = NULL;
9 
10 	while ((pmu = perf_pmu__scan(pmu))) {
11 		if (!is_pmu_core(pmu->name))
12 			continue;
13 
14 		/*
15 		 * The cpumap should cover all CPUs. Otherwise, some CPUs may
16 		 * not support some events or have different event IDs.
17 		 */
18 		if (pmu->cpus->nr != cpu__max_cpu())
19 			return NULL;
20 
21 		return perf_pmu__find_map(pmu);
22 	}
23 
24 	return NULL;
25 }
26