]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf cpumap: Tidy libperf includes
authorIan Rogers <irogers@google.com>
Wed, 9 Nov 2022 18:49:13 +0000 (10:49 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 16 Nov 2022 19:00:45 +0000 (16:00 -0300)
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>
tools/perf/arch/arm64/util/pmu.c
tools/perf/tests/cpumap.c
tools/perf/util/auxtrace.h
tools/perf/util/cpumap.c
tools/perf/util/cpumap.h
tools/perf/util/evsel.h

index f849b1e88d433e040b1ea6d63f688fe22ab47ba9..477e513972a4049ffb786e560d830de06cef2e13 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 
+#include <internal/cpumap.h>
 #include "../../../util/cpumap.h"
 #include "../../../util/pmu.h"
 
index 7c873c6ae3eb97d6c8ce80b449c398c66979e3f8..3150fc1fed6f503b5dba12de80e19712e43eb8ce 100644 (file)
@@ -6,7 +6,7 @@
 #include "util/synthetic-events.h"
 #include <string.h>
 #include <linux/bitops.h>
-#include <perf/cpumap.h>
+#include <internal/cpumap.h>
 #include "debug.h"
 
 struct machine;
index 6a0f9b98f059b62b3790cb899b18e487fe35c2fa..2cf63d37783138fb06b6580b4f0a5f017ca3894d 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/list.h>
 #include <linux/perf_event.h>
 #include <linux/types.h>
-#include <internal/cpumap.h>
+#include <perf/cpumap.h>
 #include <asm/bitsperlong.h>
 #include <asm/barrier.h>
 
index 6e3fcf523de930f0a4392e95a32fbe52fb7c7f5c..5e564974fba4ffab97d1ca511b978a60573bffe4 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/ctype.h>
 #include <linux/zalloc.h>
+#include <internal/cpumap.h>
 
 static struct perf_cpu max_cpu_num;
 static struct perf_cpu max_present_cpu_num;
index da28b3146ef9fe71fd7eab979d323d277a2a7d7b..c2f5824a3a22bbafbdd22b31a7be518a3c5df3e8 100644 (file)
@@ -4,8 +4,8 @@
 
 #include <stdbool.h>
 #include <stdio.h>
-#include <internal/cpumap.h>
 #include <perf/cpumap.h>
+#include <linux/refcount.h>
 
 /** Identify where counts are aggregated, -1 implies not to aggregate. */
 struct aggr_cpu_id {
index 467bb0b32fef8f2c5103a195caf88498882764e2..f3485799ddf9e3ed56564d08f45ad17ec68cabaf 100644 (file)
@@ -10,8 +10,6 @@
 #include <internal/evsel.h>
 #include <perf/evsel.h>
 #include "symbol_conf.h"
-#include <internal/cpumap.h>
-#include <perf/cpumap.h>
 
 struct bpf_object;
 struct cgroup;