소스 검색

perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used

To pave the way for further cleanups where linux/kernel.h may stop being
included in some header.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qqxan6tfsl6qx3l0v3nwgjvk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Arnaldo Carvalho de Melo 8 년 전
부모
커밋
877a7a1105
42개의 변경된 파일42개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      tools/perf/bench/numa.c
  2. 1 0
      tools/perf/builtin-help.c
  3. 1 0
      tools/perf/builtin-kmem.c
  4. 1 0
      tools/perf/builtin-kvm.c
  5. 1 0
      tools/perf/builtin-lock.c
  6. 1 0
      tools/perf/builtin-sched.c
  7. 1 0
      tools/perf/builtin-script.c
  8. 1 0
      tools/perf/builtin-timechart.c
  9. 1 0
      tools/perf/builtin-trace.c
  10. 1 0
      tools/perf/perf.c
  11. 1 0
      tools/perf/tests/bpf.c
  12. 1 0
      tools/perf/tests/builtin-test.c
  13. 1 0
      tools/perf/tests/clang.c
  14. 1 0
      tools/perf/tests/code-reading.c
  15. 1 0
      tools/perf/tests/dso-data.c
  16. 1 0
      tools/perf/tests/evsel-roundtrip-name.c
  17. 1 0
      tools/perf/tests/hists_common.c
  18. 1 0
      tools/perf/tests/hists_cumulate.c
  19. 1 0
      tools/perf/tests/hists_filter.c
  20. 1 0
      tools/perf/tests/hists_link.c
  21. 1 0
      tools/perf/tests/hists_output.c
  22. 1 0
      tools/perf/tests/is_printable_array.c
  23. 1 0
      tools/perf/tests/mmap-basic.c
  24. 1 1
      tools/perf/tests/parse-events.c
  25. 1 0
      tools/perf/tests/parse-no-sample-id-all.c
  26. 1 0
      tools/perf/tests/pmu.c
  27. 1 0
      tools/perf/tests/sample-parsing.c
  28. 1 0
      tools/perf/ui/browsers/annotate.c
  29. 1 0
      tools/perf/ui/tui/setup.c
  30. 1 0
      tools/perf/util/annotate.c
  31. 1 0
      tools/perf/util/bpf-loader.c
  32. 1 0
      tools/perf/util/data-convert-bt.c
  33. 1 0
      tools/perf/util/dso.c
  34. 1 0
      tools/perf/util/dwarf-regs.c
  35. 1 0
      tools/perf/util/event.c
  36. 1 0
      tools/perf/util/evlist.h
  37. 1 0
      tools/perf/util/mem-events.c
  38. 1 0
      tools/perf/util/perf-hooks.c
  39. 1 0
      tools/perf/util/session.h
  40. 1 0
      tools/perf/util/sort.c
  41. 1 0
      tools/perf/util/symbol.c
  42. 1 0
      tools/perf/util/thread.c

+ 1 - 0
tools/perf/bench/numa.c

@@ -30,6 +30,7 @@
 #include <sys/wait.h>
 #include <sys/prctl.h>
 #include <sys/types.h>
+#include <linux/kernel.h>
 #include <linux/time64.h>
 
 #include <numa.h>

+ 1 - 0
tools/perf/builtin-help.c

@@ -12,6 +12,7 @@
 #include <subcmd/run-command.h>
 #include <subcmd/help.h>
 #include "util/debug.h"
+#include <linux/kernel.h>
 
 static struct man_viewer_list {
 	struct man_viewer_list *next;

+ 1 - 0
tools/perf/builtin-kmem.c

@@ -20,6 +20,7 @@
 
 #include "util/debug.h"
 
+#include <linux/kernel.h>
 #include <linux/rbtree.h>
 #include <linux/string.h>
 #include <locale.h>

+ 1 - 0
tools/perf/builtin-kvm.c

@@ -24,6 +24,7 @@
 #include <sys/timerfd.h>
 #endif
 
+#include <linux/kernel.h>
 #include <linux/time64.h>
 #include <termios.h>
 #include <semaphore.h>

+ 1 - 0
tools/perf/builtin-lock.c

@@ -26,6 +26,7 @@
 
 #include <linux/list.h>
 #include <linux/hash.h>
+#include <linux/kernel.h>
 
 static struct perf_session *session;
 

+ 1 - 0
tools/perf/builtin-sched.c

@@ -22,6 +22,7 @@
 
 #include "util/debug.h"
 
+#include <linux/kernel.h>
 #include <linux/log2.h>
 #include <sys/prctl.h>
 #include <sys/resource.h>

+ 1 - 0
tools/perf/builtin-script.c

@@ -24,6 +24,7 @@
 #include "util/thread-stack.h"
 #include "util/time-utils.h"
 #include <linux/bitmap.h>
+#include <linux/kernel.h>
 #include <linux/stringify.h>
 #include <linux/time64.h>
 #include "asm/bug.h"

+ 1 - 0
tools/perf/builtin-timechart.c

@@ -23,6 +23,7 @@
 #include "util/cache.h"
 #include "util/evlist.h"
 #include "util/evsel.h"
+#include <linux/kernel.h>
 #include <linux/rbtree.h>
 #include <linux/time64.h>
 #include "util/symbol.h"

+ 1 - 0
tools/perf/builtin-trace.c

@@ -45,6 +45,7 @@
 #include <linux/err.h>
 #include <linux/filter.h>
 #include <linux/audit.h>
+#include <linux/kernel.h>
 #include <linux/random.h>
 #include <linux/stringify.h>
 #include <linux/time64.h>

+ 1 - 0
tools/perf/perf.c

@@ -22,6 +22,7 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include <time.h>
+#include <linux/kernel.h>
 
 const char perf_usage_string[] =
 	"perf [--version] [--help] [OPTIONS] COMMAND [ARGS]";

+ 1 - 0
tools/perf/tests/bpf.c

@@ -5,6 +5,7 @@
 #include <util/evlist.h>
 #include <linux/bpf.h>
 #include <linux/filter.h>
+#include <linux/kernel.h>
 #include <api/fs/fs.h>
 #include <bpf/bpf.h>
 #include "tests.h"

+ 1 - 0
tools/perf/tests/builtin-test.c

@@ -13,6 +13,7 @@
 #include "color.h"
 #include <subcmd/parse-options.h>
 #include "symbol.h"
+#include <linux/kernel.h>
 
 static bool dont_fork;
 

+ 1 - 0
tools/perf/tests/clang.c

@@ -2,6 +2,7 @@
 #include "debug.h"
 #include "util.h"
 #include "c++/clang-c.h"
+#include <linux/kernel.h>
 
 static struct {
 	int (*func)(void);

+ 1 - 0
tools/perf/tests/code-reading.c

@@ -1,3 +1,4 @@
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <stdlib.h>
 #include <unistd.h>

+ 1 - 0
tools/perf/tests/dso-data.c

@@ -1,4 +1,5 @@
 #include <stdlib.h>
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>

+ 1 - 0
tools/perf/tests/evsel-roundtrip-name.c

@@ -3,6 +3,7 @@
 #include "parse-events.h"
 #include "tests.h"
 #include "debug.h"
+#include <linux/kernel.h>
 
 static int perf_evsel__roundtrip_cache_name_test(void)
 {

+ 1 - 0
tools/perf/tests/hists_common.c

@@ -7,6 +7,7 @@
 #include "util/machine.h"
 #include "util/thread.h"
 #include "tests/hists_common.h"
+#include <linux/kernel.h>
 
 static struct {
 	u32 pid;

+ 1 - 0
tools/perf/tests/hists_cumulate.c

@@ -9,6 +9,7 @@
 #include "util/parse-events.h"
 #include "tests/tests.h"
 #include "tests/hists_common.h"
+#include <linux/kernel.h>
 
 struct sample {
 	u32 pid;

+ 1 - 0
tools/perf/tests/hists_filter.c

@@ -9,6 +9,7 @@
 #include "util/parse-events.h"
 #include "tests/tests.h"
 #include "tests/hists_common.h"
+#include <linux/kernel.h>
 
 struct sample {
 	u32 pid;

+ 1 - 0
tools/perf/tests/hists_link.c

@@ -9,6 +9,7 @@
 #include "thread.h"
 #include "parse-events.h"
 #include "hists_common.h"
+#include <linux/kernel.h>
 
 struct sample {
 	u32 pid;

+ 1 - 0
tools/perf/tests/hists_output.c

@@ -9,6 +9,7 @@
 #include "util/parse-events.h"
 #include "tests/tests.h"
 #include "tests/hists_common.h"
+#include <linux/kernel.h>
 
 struct sample {
 	u32 cpu;

+ 1 - 0
tools/perf/tests/is_printable_array.c

@@ -1,4 +1,5 @@
 #include <linux/compiler.h>
+#include <linux/kernel.h>
 #include "tests.h"
 #include "debug.h"
 #include "util.h"

+ 1 - 0
tools/perf/tests/mmap-basic.c

@@ -7,6 +7,7 @@
 #include "cpumap.h"
 #include "tests.h"
 #include <linux/err.h>
+#include <linux/kernel.h>
 
 /*
  * This test will generate random numbers of calls to some getpid syscalls,

+ 1 - 1
tools/perf/tests/parse-events.c

@@ -1,4 +1,3 @@
-
 #include "parse-events.h"
 #include "evsel.h"
 #include "evlist.h"
@@ -6,6 +5,7 @@
 #include "tests.h"
 #include "debug.h"
 #include "util.h"
+#include <linux/kernel.h>
 #include <linux/hw_breakpoint.h>
 #include <api/fs/fs.h>
 

+ 1 - 0
tools/perf/tests/parse-no-sample-id-all.c

@@ -1,3 +1,4 @@
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <stddef.h>
 

+ 1 - 0
tools/perf/tests/pmu.c

@@ -2,6 +2,7 @@
 #include "pmu.h"
 #include "util.h"
 #include "tests.h"
+#include <linux/kernel.h>
 
 /* Simulated format definitions. */
 static struct test_format {

+ 1 - 0
tools/perf/tests/sample-parsing.c

@@ -1,4 +1,5 @@
 #include <stdbool.h>
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 #include "util.h"

+ 1 - 0
tools/perf/ui/browsers/annotate.c

@@ -10,6 +10,7 @@
 #include "../../util/evsel.h"
 #include "../../util/config.h"
 #include <pthread.h>
+#include <linux/kernel.h>
 
 struct disasm_line_samples {
 	double		percent;

+ 1 - 0
tools/perf/ui/tui/setup.c

@@ -1,6 +1,7 @@
 #include <errno.h>
 #include <signal.h>
 #include <stdbool.h>
+#include <linux/kernel.h>
 #ifdef HAVE_BACKTRACE_SUPPORT
 #include <execinfo.h>
 #endif

+ 1 - 0
tools/perf/util/annotate.c

@@ -22,6 +22,7 @@
 #include <regex.h>
 #include <pthread.h>
 #include <linux/bitops.h>
+#include <linux/kernel.h>
 #include <sys/utsname.h>
 
 const char 	*disassembler_style;

+ 1 - 0
tools/perf/util/bpf-loader.c

@@ -9,6 +9,7 @@
 #include <bpf/libbpf.h>
 #include <bpf/bpf.h>
 #include <linux/err.h>
+#include <linux/kernel.h>
 #include <linux/string.h>
 #include "perf.h"
 #include "debug.h"

+ 1 - 0
tools/perf/util/data-convert-bt.c

@@ -8,6 +8,7 @@
  */
 
 #include <linux/compiler.h>
+#include <linux/kernel.h>
 #include <babeltrace/ctf-writer/writer.h>
 #include <babeltrace/ctf-writer/clock.h>
 #include <babeltrace/ctf-writer/stream.h>

+ 1 - 0
tools/perf/util/dso.c

@@ -1,4 +1,5 @@
 #include <asm/bug.h>
+#include <linux/kernel.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include "symbol.h"

+ 1 - 0
tools/perf/util/dwarf-regs.c

@@ -8,6 +8,7 @@
 #include <debug.h>
 #include <dwarf-regs.h>
 #include <elf.h>
+#include <linux/kernel.h>
 
 #ifndef EM_AARCH64
 #define EM_AARCH64	183  /* ARM 64 bit */

+ 1 - 0
tools/perf/util/event.c

@@ -1,3 +1,4 @@
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
 #include <api/fs/fs.h>

+ 1 - 0
tools/perf/util/evlist.h

@@ -1,6 +1,7 @@
 #ifndef __PERF_EVLIST_H
 #define __PERF_EVLIST_H 1
 
+#include <linux/kernel.h>
 #include <linux/refcount.h>
 #include <linux/list.h>
 #include <api/fd/array.h>

+ 1 - 0
tools/perf/util/mem-events.c

@@ -6,6 +6,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <api/fs/fs.h>
+#include <linux/kernel.h>
 #include "mem-events.h"
 #include "debug.h"
 #include "symbol.h"

+ 1 - 0
tools/perf/util/perf-hooks.c

@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <setjmp.h>
 #include <linux/err.h>
+#include <linux/kernel.h>
 #include "util/util.h"
 #include "util/debug.h"
 #include "util/perf-hooks.h"

+ 1 - 0
tools/perf/util/session.h

@@ -9,6 +9,7 @@
 #include "thread.h"
 #include "data.h"
 #include "ordered-events.h"
+#include <linux/kernel.h>
 #include <linux/rbtree.h>
 #include <linux/perf_event.h>
 

+ 1 - 0
tools/perf/util/sort.c

@@ -7,6 +7,7 @@
 #include "evlist.h"
 #include <traceevent/event-parse.h>
 #include "mem-events.h"
+#include <linux/kernel.h>
 
 regex_t		parent_regex;
 const char	default_parent_pattern[] = "^sys_|^do_page_fault";

+ 1 - 0
tools/perf/util/symbol.c

@@ -3,6 +3,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <linux/kernel.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>

+ 1 - 0
tools/perf/util/thread.c

@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <linux/kernel.h>
 #include "session.h"
 #include "thread.h"
 #include "thread-stack.h"