Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf event: Remove needless include directives from event.h

bpf.h and build-id.h are not needed at all in event.h, remove them.

And fixup the fallout of files that were getting needed stuff from this
now pruned include.

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-rdm3dgtlrndmmnlc4bafsg3b@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+20 -6
+1
tools/perf/arch/powerpc/util/unwind-libdw.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <elfutils/libdwfl.h> 3 + #include <linux/kernel.h> 3 4 #include "../../util/unwind-libdw.h" 4 5 #include "../../util/perf_regs.h" 5 6 #include "../../util/event.h"
+1
tools/perf/arch/x86/util/perf_regs.c
··· 2 2 #include <errno.h> 3 3 #include <string.h> 4 4 #include <regex.h> 5 + #include <linux/kernel.h> 5 6 #include <linux/zalloc.h> 6 7 7 8 #include "../../perf-sys.h"
+1
tools/perf/perf.c
··· 10 10 #include "builtin.h" 11 11 #include "perf.h" 12 12 13 + #include "util/build-id.h" 13 14 #include "util/cache.h" 14 15 #include "util/env.h" 15 16 #include <subcmd/exec-cmd.h>
+1
tools/perf/util/bpf-event.h
··· 13 13 union perf_event; 14 14 struct perf_env; 15 15 struct perf_sample; 16 + struct perf_session; 16 17 struct record_opts; 17 18 struct evlist; 18 19 struct target;
+1
tools/perf/util/callchain.h
··· 8 8 #include "map_symbol.h" 9 9 #include "branch.h" 10 10 11 + struct evsel; 11 12 struct map; 12 13 13 14 #define HELP_PAD "\t\t\t\t"
+2
tools/perf/util/config.c
··· 17 17 #include "util/event.h" /* proc_map_timeout */ 18 18 #include "util/hist.h" /* perf_hist_config */ 19 19 #include "util/llvm-utils.h" /* perf_llvm_config */ 20 + #include "build-id.h" 21 + #include "debug.h" 20 22 #include "config.h" 21 23 #include "debug.h" 22 24 #include <sys/types.h>
+1
tools/perf/util/debug.c
··· 8 8 #include <stdlib.h> 9 9 #include <sys/wait.h> 10 10 #include <api/debug.h> 11 + #include <linux/kernel.h> 11 12 #include <linux/time64.h> 12 13 #ifdef HAVE_BACKTRACE_SUPPORT 13 14 #include <execinfo.h>
+12 -6
tools/perf/util/event.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 #ifndef __PERF_RECORD_H 3 3 #define __PERF_RECORD_H 4 - 5 - #include <limits.h> 4 + /* 5 + * The linux/stddef.h isn't need here, but is needed for __always_inline used 6 + * in files included from uapi/linux/perf_event.h such as 7 + * /usr/include/linux/swab.h and /usr/include/linux/byteorder/little_endian.h, 8 + * detected in at least musl libc, used in Alpine Linux. -acme 9 + */ 6 10 #include <stdio.h> 7 - #include <linux/kernel.h> 8 - #include <linux/bpf.h> 9 - #include <linux/perf_event.h> 11 + #include <linux/stddef.h> 10 12 #include <perf/event.h> 13 + #include <linux/types.h> 11 14 12 - #include "build-id.h" 13 15 #include "perf_regs.h" 16 + 17 + struct dso; 18 + struct machine; 19 + struct perf_event_attr; 14 20 15 21 #ifdef __LP64__ 16 22 /*