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

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>

+42 -1
+1
tools/perf/bench/numa.c
··· 30 30 #include <sys/wait.h> 31 31 #include <sys/prctl.h> 32 32 #include <sys/types.h> 33 + #include <linux/kernel.h> 33 34 #include <linux/time64.h> 34 35 35 36 #include <numa.h>
+1
tools/perf/builtin-help.c
··· 12 12 #include <subcmd/run-command.h> 13 13 #include <subcmd/help.h> 14 14 #include "util/debug.h" 15 + #include <linux/kernel.h> 15 16 16 17 static struct man_viewer_list { 17 18 struct man_viewer_list *next;
+1
tools/perf/builtin-kmem.c
··· 20 20 21 21 #include "util/debug.h" 22 22 23 + #include <linux/kernel.h> 23 24 #include <linux/rbtree.h> 24 25 #include <linux/string.h> 25 26 #include <locale.h>
+1
tools/perf/builtin-kvm.c
··· 24 24 #include <sys/timerfd.h> 25 25 #endif 26 26 27 + #include <linux/kernel.h> 27 28 #include <linux/time64.h> 28 29 #include <termios.h> 29 30 #include <semaphore.h>
+1
tools/perf/builtin-lock.c
··· 26 26 27 27 #include <linux/list.h> 28 28 #include <linux/hash.h> 29 + #include <linux/kernel.h> 29 30 30 31 static struct perf_session *session; 31 32
+1
tools/perf/builtin-sched.c
··· 22 22 23 23 #include "util/debug.h" 24 24 25 + #include <linux/kernel.h> 25 26 #include <linux/log2.h> 26 27 #include <sys/prctl.h> 27 28 #include <sys/resource.h>
+1
tools/perf/builtin-script.c
··· 24 24 #include "util/thread-stack.h" 25 25 #include "util/time-utils.h" 26 26 #include <linux/bitmap.h> 27 + #include <linux/kernel.h> 27 28 #include <linux/stringify.h> 28 29 #include <linux/time64.h> 29 30 #include "asm/bug.h"
+1
tools/perf/builtin-timechart.c
··· 23 23 #include "util/cache.h" 24 24 #include "util/evlist.h" 25 25 #include "util/evsel.h" 26 + #include <linux/kernel.h> 26 27 #include <linux/rbtree.h> 27 28 #include <linux/time64.h> 28 29 #include "util/symbol.h"
+1
tools/perf/builtin-trace.c
··· 45 45 #include <linux/err.h> 46 46 #include <linux/filter.h> 47 47 #include <linux/audit.h> 48 + #include <linux/kernel.h> 48 49 #include <linux/random.h> 49 50 #include <linux/stringify.h> 50 51 #include <linux/time64.h>
+1
tools/perf/perf.c
··· 22 22 #include <pthread.h> 23 23 #include <stdlib.h> 24 24 #include <time.h> 25 + #include <linux/kernel.h> 25 26 26 27 const char perf_usage_string[] = 27 28 "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]";
+1
tools/perf/tests/bpf.c
··· 5 5 #include <util/evlist.h> 6 6 #include <linux/bpf.h> 7 7 #include <linux/filter.h> 8 + #include <linux/kernel.h> 8 9 #include <api/fs/fs.h> 9 10 #include <bpf/bpf.h> 10 11 #include "tests.h"
+1
tools/perf/tests/builtin-test.c
··· 13 13 #include "color.h" 14 14 #include <subcmd/parse-options.h> 15 15 #include "symbol.h" 16 + #include <linux/kernel.h> 16 17 17 18 static bool dont_fork; 18 19
+1
tools/perf/tests/clang.c
··· 2 2 #include "debug.h" 3 3 #include "util.h" 4 4 #include "c++/clang-c.h" 5 + #include <linux/kernel.h> 5 6 6 7 static struct { 7 8 int (*func)(void);
+1
tools/perf/tests/code-reading.c
··· 1 + #include <linux/kernel.h> 1 2 #include <linux/types.h> 2 3 #include <stdlib.h> 3 4 #include <unistd.h>
+1
tools/perf/tests/dso-data.c
··· 1 1 #include <stdlib.h> 2 + #include <linux/kernel.h> 2 3 #include <linux/types.h> 3 4 #include <sys/stat.h> 4 5 #include <fcntl.h>
+1
tools/perf/tests/evsel-roundtrip-name.c
··· 3 3 #include "parse-events.h" 4 4 #include "tests.h" 5 5 #include "debug.h" 6 + #include <linux/kernel.h> 6 7 7 8 static int perf_evsel__roundtrip_cache_name_test(void) 8 9 {
+1
tools/perf/tests/hists_common.c
··· 7 7 #include "util/machine.h" 8 8 #include "util/thread.h" 9 9 #include "tests/hists_common.h" 10 + #include <linux/kernel.h> 10 11 11 12 static struct { 12 13 u32 pid;
+1
tools/perf/tests/hists_cumulate.c
··· 9 9 #include "util/parse-events.h" 10 10 #include "tests/tests.h" 11 11 #include "tests/hists_common.h" 12 + #include <linux/kernel.h> 12 13 13 14 struct sample { 14 15 u32 pid;
+1
tools/perf/tests/hists_filter.c
··· 9 9 #include "util/parse-events.h" 10 10 #include "tests/tests.h" 11 11 #include "tests/hists_common.h" 12 + #include <linux/kernel.h> 12 13 13 14 struct sample { 14 15 u32 pid;
+1
tools/perf/tests/hists_link.c
··· 9 9 #include "thread.h" 10 10 #include "parse-events.h" 11 11 #include "hists_common.h" 12 + #include <linux/kernel.h> 12 13 13 14 struct sample { 14 15 u32 pid;
+1
tools/perf/tests/hists_output.c
··· 9 9 #include "util/parse-events.h" 10 10 #include "tests/tests.h" 11 11 #include "tests/hists_common.h" 12 + #include <linux/kernel.h> 12 13 13 14 struct sample { 14 15 u32 cpu;
+1
tools/perf/tests/is_printable_array.c
··· 1 1 #include <linux/compiler.h> 2 + #include <linux/kernel.h> 2 3 #include "tests.h" 3 4 #include "debug.h" 4 5 #include "util.h"
+1
tools/perf/tests/mmap-basic.c
··· 7 7 #include "cpumap.h" 8 8 #include "tests.h" 9 9 #include <linux/err.h> 10 + #include <linux/kernel.h> 10 11 11 12 /* 12 13 * This test will generate random numbers of calls to some getpid syscalls,
+1 -1
tools/perf/tests/parse-events.c
··· 1 - 2 1 #include "parse-events.h" 3 2 #include "evsel.h" 4 3 #include "evlist.h" ··· 5 6 #include "tests.h" 6 7 #include "debug.h" 7 8 #include "util.h" 9 + #include <linux/kernel.h> 8 10 #include <linux/hw_breakpoint.h> 9 11 #include <api/fs/fs.h> 10 12
+1
tools/perf/tests/parse-no-sample-id-all.c
··· 1 + #include <linux/kernel.h> 1 2 #include <linux/types.h> 2 3 #include <stddef.h> 3 4
+1
tools/perf/tests/pmu.c
··· 2 2 #include "pmu.h" 3 3 #include "util.h" 4 4 #include "tests.h" 5 + #include <linux/kernel.h> 5 6 6 7 /* Simulated format definitions. */ 7 8 static struct test_format {
+1
tools/perf/tests/sample-parsing.c
··· 1 1 #include <stdbool.h> 2 + #include <linux/kernel.h> 2 3 #include <linux/types.h> 3 4 4 5 #include "util.h"
+1
tools/perf/ui/browsers/annotate.c
··· 10 10 #include "../../util/evsel.h" 11 11 #include "../../util/config.h" 12 12 #include <pthread.h> 13 + #include <linux/kernel.h> 13 14 14 15 struct disasm_line_samples { 15 16 double percent;
+1
tools/perf/ui/tui/setup.c
··· 1 1 #include <errno.h> 2 2 #include <signal.h> 3 3 #include <stdbool.h> 4 + #include <linux/kernel.h> 4 5 #ifdef HAVE_BACKTRACE_SUPPORT 5 6 #include <execinfo.h> 6 7 #endif
+1
tools/perf/util/annotate.c
··· 22 22 #include <regex.h> 23 23 #include <pthread.h> 24 24 #include <linux/bitops.h> 25 + #include <linux/kernel.h> 25 26 #include <sys/utsname.h> 26 27 27 28 const char *disassembler_style;
+1
tools/perf/util/bpf-loader.c
··· 9 9 #include <bpf/libbpf.h> 10 10 #include <bpf/bpf.h> 11 11 #include <linux/err.h> 12 + #include <linux/kernel.h> 12 13 #include <linux/string.h> 13 14 #include "perf.h" 14 15 #include "debug.h"
+1
tools/perf/util/data-convert-bt.c
··· 8 8 */ 9 9 10 10 #include <linux/compiler.h> 11 + #include <linux/kernel.h> 11 12 #include <babeltrace/ctf-writer/writer.h> 12 13 #include <babeltrace/ctf-writer/clock.h> 13 14 #include <babeltrace/ctf-writer/stream.h>
+1
tools/perf/util/dso.c
··· 1 1 #include <asm/bug.h> 2 + #include <linux/kernel.h> 2 3 #include <sys/time.h> 3 4 #include <sys/resource.h> 4 5 #include "symbol.h"
+1
tools/perf/util/dwarf-regs.c
··· 8 8 #include <debug.h> 9 9 #include <dwarf-regs.h> 10 10 #include <elf.h> 11 + #include <linux/kernel.h> 11 12 12 13 #ifndef EM_AARCH64 13 14 #define EM_AARCH64 183 /* ARM 64 bit */
+1
tools/perf/util/event.c
··· 1 + #include <linux/kernel.h> 1 2 #include <linux/types.h> 2 3 #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ 3 4 #include <api/fs/fs.h>
+1
tools/perf/util/evlist.h
··· 1 1 #ifndef __PERF_EVLIST_H 2 2 #define __PERF_EVLIST_H 1 3 3 4 + #include <linux/kernel.h> 4 5 #include <linux/refcount.h> 5 6 #include <linux/list.h> 6 7 #include <api/fd/array.h>
+1
tools/perf/util/mem-events.c
··· 6 6 #include <sys/stat.h> 7 7 #include <unistd.h> 8 8 #include <api/fs/fs.h> 9 + #include <linux/kernel.h> 9 10 #include "mem-events.h" 10 11 #include "debug.h" 11 12 #include "symbol.h"
+1
tools/perf/util/perf-hooks.c
··· 9 9 #include <stdlib.h> 10 10 #include <setjmp.h> 11 11 #include <linux/err.h> 12 + #include <linux/kernel.h> 12 13 #include "util/util.h" 13 14 #include "util/debug.h" 14 15 #include "util/perf-hooks.h"
+1
tools/perf/util/session.h
··· 9 9 #include "thread.h" 10 10 #include "data.h" 11 11 #include "ordered-events.h" 12 + #include <linux/kernel.h> 12 13 #include <linux/rbtree.h> 13 14 #include <linux/perf_event.h> 14 15
+1
tools/perf/util/sort.c
··· 7 7 #include "evlist.h" 8 8 #include <traceevent/event-parse.h> 9 9 #include "mem-events.h" 10 + #include <linux/kernel.h> 10 11 11 12 regex_t parent_regex; 12 13 const char default_parent_pattern[] = "^sys_|^do_page_fault";
+1
tools/perf/util/symbol.c
··· 3 3 #include <stdlib.h> 4 4 #include <stdio.h> 5 5 #include <string.h> 6 + #include <linux/kernel.h> 6 7 #include <sys/types.h> 7 8 #include <sys/stat.h> 8 9 #include <sys/param.h>
+1
tools/perf/util/thread.c
··· 2 2 #include <stdlib.h> 3 3 #include <stdio.h> 4 4 #include <string.h> 5 + #include <linux/kernel.h> 5 6 #include "session.h" 6 7 #include "thread.h" 7 8 #include "thread-stack.h"