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