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>
This commit is contained in:
Arnaldo Carvalho de Melo 2017-04-17 11:39:06 -03:00
parent 8607c1ee73
commit 877a7a1105
42 changed files with 42 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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