Use public API when possible, don't include internal API in header files in evsel.h. Fix any related breakages. Committer note: There was one missing case, when building for arm64: arch/arm64/util/pmu.c: In function 'pmu_events_table__find': arch/arm64/util/pmu.c:18:30: error: invalid use of undefined type 'struct perf_cpu_map' 18 | if (pmu->cpus->nr != cpu__max_cpu().cpu) | ^~ Fix it by adding one more exception, including <internal/cpumap.h> Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Nicolas Schier <nicolas@fjasle.eu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20221109184914.1357295-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
26 lines
558 B
C
26 lines
558 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <internal/cpumap.h>
|
|
#include "../../../util/cpumap.h"
|
|
#include "../../../util/pmu.h"
|
|
|
|
const struct pmu_events_table *pmu_events_table__find(void)
|
|
{
|
|
struct perf_pmu *pmu = NULL;
|
|
|
|
while ((pmu = perf_pmu__scan(pmu))) {
|
|
if (!is_pmu_core(pmu->name))
|
|
continue;
|
|
|
|
/*
|
|
* The cpumap should cover all CPUs. Otherwise, some CPUs may
|
|
* not support some events or have different event IDs.
|
|
*/
|
|
if (pmu->cpus->nr != cpu__max_cpu().cpu)
|
|
return NULL;
|
|
|
|
return perf_pmu__find_table(pmu);
|
|
}
|
|
|
|
return NULL;
|
|
}
|