perf env: Remove needless cpumap.h header

Only a 'struct perf_cmp_map' forward allocation is necessary, fix the
places that need the header but were getting it indirectly, by luck,
from env.h.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-3sj3n534zghxhk7ygzeaqlx9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-09-10 16:29:02 +01:00
parent 09aa3b002c
commit 87ffb6c640
37 changed files with 31 additions and 34 deletions

View File

@ -1,5 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <perf/cpumap.h>
#include <internal/cpumap.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include "debug.h" #include "debug.h"
#include "header.h" #include "header.h"
@ -29,7 +31,7 @@ char *get_cpuid_str(struct perf_pmu *pmu)
/* read midr from list of cpus mapped to this pmu */ /* read midr from list of cpus mapped to this pmu */
cpus = perf_cpu_map__get(pmu->cpus); cpus = perf_cpu_map__get(pmu->cpus);
for (cpu = 0; cpu < cpus->nr; cpu++) { for (cpu = 0; cpu < perf_cpu_map__nr(cpus); cpu++) {
scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR, scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
sysfs, cpus->map[cpu]); sysfs, cpus->map[cpu]);

View File

@ -15,7 +15,6 @@
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "record.h" #include "record.h"
#include "tsc.h" #include "tsc.h"
#include "tests/tests.h" #include "tests/tests.h"

View File

@ -21,12 +21,12 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "../util/stat.h" #include "../util/stat.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "bench.h" #include "bench.h"
#include "cpumap.h"
#include <err.h> #include <err.h>

View File

@ -76,12 +76,12 @@
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include <sys/types.h> #include <sys/types.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "../util/stat.h" #include "../util/stat.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "bench.h" #include "bench.h"
#include "cpumap.h"
#include <err.h> #include <err.h>

View File

@ -20,13 +20,13 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include <sys/time.h> #include <sys/time.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "../util/stat.h" #include "../util/stat.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "bench.h" #include "bench.h"
#include "futex.h" #include "futex.h"
#include "cpumap.h"
#include <err.h> #include <err.h>

View File

@ -14,10 +14,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include <errno.h> #include <errno.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "bench.h" #include "bench.h"
#include "futex.h" #include "futex.h"
#include "cpumap.h"
#include <err.h> #include <err.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -20,10 +20,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <errno.h> #include <errno.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "bench.h" #include "bench.h"
#include "futex.h" #include "futex.h"
#include "cpumap.h"
#include <err.h> #include <err.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -29,7 +29,8 @@ int bench_futex_wake_parallel(int argc __maybe_unused, const char **argv __maybe
#include <linux/time64.h> #include <linux/time64.h>
#include <errno.h> #include <errno.h>
#include "futex.h" #include "futex.h"
#include "cpumap.h" #include <internal/cpumap.h>
#include <perf/cpumap.h>
#include <err.h> #include <err.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -20,10 +20,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <errno.h> #include <errno.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "bench.h" #include "bench.h"
#include "futex.h" #include "futex.h"
#include "cpumap.h"
#include <err.h> #include <err.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -20,6 +20,7 @@
#include <sys/param.h> #include <sys/param.h>
#include "debug.h" #include "debug.h"
#include "builtin.h" #include "builtin.h"
#include <perf/cpumap.h>
#include <subcmd/pager.h> #include <subcmd/pager.h>
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "map_symbol.h" #include "map_symbol.h"

View File

@ -3,6 +3,7 @@
#include "perf.h" #include "perf.h"
#include "perf-sys.h" #include "perf-sys.h"
#include "util/cpumap.h"
#include "util/evlist.h" #include "util/evlist.h"
#include "util/evsel.h" #include "util/evsel.h"
#include "util/symbol.h" #include "util/symbol.h"
@ -36,6 +37,7 @@
#include <pthread.h> #include <pthread.h>
#include <math.h> #include <math.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <perf/cpumap.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <linux/ctype.h> #include <linux/ctype.h>

View File

@ -2,8 +2,8 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include <internal/cpumap.h>
#include "tests.h" #include "tests.h"
#include "cpumap.h"
#include "debug.h" #include "debug.h"
#define NBITS 100 #define NBITS 100

View File

@ -19,7 +19,6 @@
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "machine.h" #include "machine.h"
#include "map.h" #include "map.h"
#include "symbol.h" #include "symbol.h"

View File

@ -2,6 +2,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include <string.h> #include <string.h>
#include "cpumap.h"
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "header.h" #include "header.h"

View File

@ -12,7 +12,6 @@
#include "evsel.h" #include "evsel.h"
#include "record.h" #include "record.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "tests.h" #include "tests.h"
#define CHECK__(x) { \ #define CHECK__(x) { \
@ -143,7 +142,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
found = find_comm(evlist, comm); found = find_comm(evlist, comm);
if (found != 1) { if (found != 1) {
pr_debug("Seconf time, failed to find tracking event.\n"); pr_debug("Second time, failed to find tracking event.\n");
goto out_err; goto out_err;
} }

View File

@ -4,7 +4,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "cpumap.h" #include <internal/cpumap.h>
#include "debug.h" #include "debug.h"
#include "env.h" #include "env.h"
#include "mem2node.h" #include "mem2node.h"

View File

@ -10,7 +10,6 @@
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "tests.h" #include "tests.h"
#include <linux/err.h> #include <linux/err.h>
#include <linux/kernel.h> #include <linux/kernel.h>
@ -53,7 +52,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
cpus = perf_cpu_map__new(NULL); cpus = perf_cpu_map__new(NULL);
if (cpus == NULL) { if (cpus == NULL) {
pr_debug("cpu_map__new\n"); pr_debug("perf_cpu_map__new\n");
goto out_free_threads; goto out_free_threads;
} }

View File

@ -14,7 +14,8 @@
#include "evsel.h" #include "evsel.h"
#include "tests.h" #include "tests.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h" #include <perf/cpumap.h>
#include <internal/cpumap.h>
#include "debug.h" #include "debug.h"
#include "stat.h" #include "stat.h"
#include "util/counts.h" #include "util/counts.h"
@ -37,7 +38,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
cpus = perf_cpu_map__new(NULL); cpus = perf_cpu_map__new(NULL);
if (cpus == NULL) { if (cpus == NULL) {
pr_debug("cpu_map__new\n"); pr_debug("perf_cpu_map__new\n");
goto out_thread_map_delete; goto out_thread_map_delete;
} }

View File

@ -14,7 +14,6 @@
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "record.h" #include "record.h"
#include "tests.h" #include "tests.h"

View File

@ -4,12 +4,12 @@
#include "evsel.h" #include "evsel.h"
#include "target.h" #include "target.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "tests.h" #include "tests.h"
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <linux/string.h> #include <linux/string.h>
#include <perf/cpumap.h>
#include <perf/evlist.h> #include <perf/evlist.h>
static int exited; static int exited;

View File

@ -3,6 +3,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "cpumap.h"
#include "tests.h" #include "tests.h"
#include "session.h" #include "session.h"
#include "evlist.h" #include "evlist.h"

View File

@ -16,7 +16,6 @@
#include <linux/log2.h> #include <linux/log2.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include "cpumap.h"
#include "color.h" #include "color.h"
#include "evsel.h" #include "evsel.h"
#include "machine.h" #include "machine.h"

View File

@ -31,7 +31,6 @@
#include "map.h" #include "map.h"
#include "pmu.h" #include "pmu.h"
#include "evsel.h" #include "evsel.h"
#include "cpumap.h"
#include "symbol.h" #include "symbol.h"
#include "thread_map.h" #include "thread_map.h"
#include "asm/bug.h" #include "asm/bug.h"

View File

@ -4,9 +4,10 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include "cpumap.h"
#include "rwsem.h" #include "rwsem.h"
struct perf_cpu_map;
struct cpu_topology_map { struct cpu_topology_map {
int socket_id; int socket_id;
int die_id; int die_id;

View File

@ -4,6 +4,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <perf/cpumap.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
@ -11,6 +12,7 @@
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include "cpumap.h"
#include "dso.h" #include "dso.h"
#include "event.h" #include "event.h"
#include "debug.h" #include "debug.h"

View File

@ -31,7 +31,7 @@
#include "event.h" #include "event.h"
#include "evsel.h" #include "evsel.h"
#include "evlist.h" #include "evlist.h"
#include "cpumap.h" #include <perf/cpumap.h>
#include "thread_map.h" #include "thread_map.h"
#include "target.h" #include "target.h"
#include "perf_regs.h" #include "perf_regs.h"

View File

@ -14,7 +14,6 @@
#include <linux/log2.h> #include <linux/log2.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include "cpumap.h"
#include "color.h" #include "color.h"
#include "evsel.h" #include "evsel.h"
#include "evlist.h" #include "evlist.h"

View File

@ -30,7 +30,6 @@
#include "parse-events-flex.h" #include "parse-events-flex.h"
#include "pmu.h" #include "pmu.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "probe-file.h" #include "probe-file.h"
#include "asm/bug.h" #include "asm/bug.h"
#include "util/parse-branch-options.h" #include "util/parse-branch-options.h"

View File

@ -20,7 +20,6 @@
#include "debug.h" #include "debug.h"
#include "pmu.h" #include "pmu.h"
#include "parse-events.h" #include "parse-events.h"
#include "cpumap.h"
#include "header.h" #include "header.h"
#include "pmu-events/pmu-events.h" #include "pmu-events/pmu-events.h"
#include "string2.h" #include "string2.h"

View File

@ -11,7 +11,6 @@
#include "callchain.h" #include "callchain.h"
#include "evsel.h" #include "evsel.h"
#include "event.h" #include "event.h"
#include "cpumap.h"
#include "print_binary.h" #include "print_binary.h"
#include "thread_map.h" #include "thread_map.h"
#include "trace-event.h" #include "trace-event.h"

View File

@ -2,7 +2,6 @@
#include "debug.h" #include "debug.h"
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "cpumap.h"
#include "parse-events.h" #include "parse-events.h"
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>

View File

@ -151,7 +151,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include "cpumap.h"
#include "color.h" #include "color.h"
#include "evsel.h" #include "evsel.h"
#include "evlist.h" #include "evlist.h"

View File

@ -48,7 +48,6 @@
#include "map.h" #include "map.h"
#include "symbol.h" #include "symbol.h"
#include "thread_map.h" #include "thread_map.h"
#include "cpumap.h"
#include "print_binary.h" #include "print_binary.h"
#include "stat.h" #include "stat.h"
#include "mem-events.h" #include "mem-events.h"

View File

@ -22,7 +22,6 @@
#include "symbol.h" #include "symbol.h"
#include "session.h" #include "session.h"
#include "tool.h" #include "tool.h"
#include "cpumap.h"
#include "perf_regs.h" #include "perf_regs.h"
#include "asm/bug.h" #include "asm/bug.h"
#include "auxtrace.h" #include "auxtrace.h"

View File

@ -4,6 +4,7 @@
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include "counts.h" #include "counts.h"
#include "cpumap.h"
#include "debug.h" #include "debug.h"
#include "header.h" #include "header.h"
#include "stat.h" #include "stat.h"

View File

@ -17,11 +17,11 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/time64.h> #include <linux/time64.h>
#include <linux/zalloc.h> #include <linux/zalloc.h>
#include <internal/cpumap.h>
#include <perf/cpumap.h> #include <perf/cpumap.h>
#include "env.h" #include "env.h"
#include "svghelper.h" #include "svghelper.h"
#include "cpumap.h"
static u64 first_time, last_time; static u64 first_time, last_time;
static u64 turbo_frequency, max_freq; static u64 turbo_frequency, max_freq;

View File

@ -5,7 +5,6 @@
* Refactored from builtin-top.c, see that files for further copyright notes. * Refactored from builtin-top.c, see that files for further copyright notes.
*/ */
#include "cpumap.h"
#include "event.h" #include "event.h"
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"