perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 17 Apr 2017 14:39:06 +0000 (11:39 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Apr 2017 16:01:44 +0000 (13:01 -0300)
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 files changed:
tools/perf/bench/numa.c
tools/perf/builtin-help.c
tools/perf/builtin-kmem.c
tools/perf/builtin-kvm.c
tools/perf/builtin-lock.c
tools/perf/builtin-sched.c
tools/perf/builtin-script.c
tools/perf/builtin-timechart.c
tools/perf/builtin-trace.c
tools/perf/perf.c
tools/perf/tests/bpf.c
tools/perf/tests/builtin-test.c
tools/perf/tests/clang.c
tools/perf/tests/code-reading.c
tools/perf/tests/dso-data.c
tools/perf/tests/evsel-roundtrip-name.c
tools/perf/tests/hists_common.c
tools/perf/tests/hists_cumulate.c
tools/perf/tests/hists_filter.c
tools/perf/tests/hists_link.c
tools/perf/tests/hists_output.c
tools/perf/tests/is_printable_array.c
tools/perf/tests/mmap-basic.c
tools/perf/tests/parse-events.c
tools/perf/tests/parse-no-sample-id-all.c
tools/perf/tests/pmu.c
tools/perf/tests/sample-parsing.c
tools/perf/ui/browsers/annotate.c
tools/perf/ui/tui/setup.c
tools/perf/util/annotate.c
tools/perf/util/bpf-loader.c
tools/perf/util/data-convert-bt.c
tools/perf/util/dso.c
tools/perf/util/dwarf-regs.c
tools/perf/util/event.c
tools/perf/util/evlist.h
tools/perf/util/mem-events.c
tools/perf/util/perf-hooks.c
tools/perf/util/session.h
tools/perf/util/sort.c
tools/perf/util/symbol.c
tools/perf/util/thread.c

index 1fe43bd5a0123e7a4276e427efc89fddce2941d7..27ebd50ee619aade7d4f402d5ab4a0d6929bc156 100644 (file)
@@ -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>
index 9730fd409f3b7825f6ff73c3cb9136f63fcc6943..1f18385907f5da6a1d0fbfc7a2289520702e4b97 100644 (file)
@@ -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;
index 515587825af4ebe595d6c7a0273bf00de5f8d622..8f0b94563936c8a20d064e38504fc50f6079c3de 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "util/debug.h"
 
+#include <linux/kernel.h>
 #include <linux/rbtree.h>
 #include <linux/string.h>
 #include <locale.h>
index 38b409173693afd778c4727185c949544daca32a..a7d7f4c6052e2ff89ff492cf395807189eaeeb05 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/timerfd.h>
 #endif
 
+#include <linux/kernel.h>
 #include <linux/time64.h>
 #include <termios.h>
 #include <semaphore.h>
index b686fb6759daa13b01c75670d5e86e594f35b43e..f74dd869f88b95d5506ef63e0be5f316f6266551 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <linux/list.h>
 #include <linux/hash.h>
+#include <linux/kernel.h>
 
 static struct perf_session *session;
 
index 79833e226789ecbb25cc64fc2a2e61d46fa15eee..5cd60882c8d924b90c67fae6aff89d29378bef72 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "util/debug.h"
 
+#include <linux/kernel.h>
 #include <linux/log2.h>
 #include <sys/prctl.h>
 #include <sys/resource.h>
index 2dab70fba2babbbd25473fd5acba463fb03bcc5c..36b076653d1674b4dc8079a97a2f6d1c3f210851 100644 (file)
@@ -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"
index fafdb44b8bcb41c07f6c59991da5a8c619566673..822c8d39ca1d50f0b77a582ec76a97b256920495 100644 (file)
@@ -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"
index fce278d5fadad20c42500242894d48f1c7d47156..2792ed1fae438dfb1d60e889fea9fed80edcdb77 100644 (file)
@@ -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>
index 9dc346f2b255ca08e4512545178c0e492138637e..07ee1352f4ed2fd5b64bf9cb1d593c51228ffed5 100644 (file)
@@ -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]";
index 1a04fe77487dc54512b3764f8a89961364c9ad45..67fe5eeff021864af7f35347f5157642211367de 100644 (file)
@@ -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"
index e6d7876c94c223716176caba951d5ff5791ceff3..f029737ad2552832ec4584b670323e189efc19eb 100644 (file)
@@ -13,6 +13,7 @@
 #include "color.h"
 #include <subcmd/parse-options.h>
 #include "symbol.h"
+#include <linux/kernel.h>
 
 static bool dont_fork;
 
index f853e242a86c014ecfb80da3a6fa30f64295c963..c5bb2203f5a90850564397998a8af4b8cb3bfbc1 100644 (file)
@@ -2,6 +2,7 @@
 #include "debug.h"
 #include "util.h"
 #include "c++/clang-c.h"
+#include <linux/kernel.h>
 
 static struct {
        int (*func)(void);
index d1f693041324a8a6670ff56081537c3ed3f528f0..99dbd5ae294a70ae34a37e808349eca1849e6601 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <stdlib.h>
 #include <unistd.h>
index 13725e09ba22447ed97b498e6751a34c2a027cbf..46ea2e061b86f00849ea385086b8381972348e63 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdlib.h>
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
index 60926a1f6fd7fcf128924759545d7f6620128406..9221d2732cc449dab125055670fe845c187c1f84 100644 (file)
@@ -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)
 {
index 6b21746d6eec84b0bf443fc4cd05523be57f9878..f6c580e3ed843eb5dad552de0c8edbe53adafe30 100644 (file)
@@ -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;
index 9fd54b79a7886266889f17f5865d69b46171cbf3..70918b9865681b5e01d9ad5e2f4512b2a6edb2fb 100644 (file)
@@ -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;
index 62efb14f3a5a7eabb0dfbc7bae31e90276ef9c54..f171b2da48990510a32bb00bc17016bf04af4471 100644 (file)
@@ -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;
index eddc7407ff8a9341a2e19e859bf1cab8781e8eda..1bd26d23c2fcdf43bd909734116f827b94ad1d07 100644 (file)
@@ -9,6 +9,7 @@
 #include "thread.h"
 #include "parse-events.h"
 #include "hists_common.h"
+#include <linux/kernel.h>
 
 struct sample {
        u32 pid;
index 63c5efaba1b5c611d3bb96da433d93415b3b87ca..cdf0dde5fe9712b803bffcf98617dcb73fcbb2d3 100644 (file)
@@ -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;
index 42e13393e5028c2d1bfe515b990b0e79275e96c3..a008e5c2d980a617c27c23d7bbb04616f5322d03 100644 (file)
@@ -1,4 +1,5 @@
 #include <linux/compiler.h>
+#include <linux/kernel.h>
 #include "tests.h"
 #include "debug.h"
 #include "util.h"
index 634bce9caebd343278e24f6c32ab3569f9bc003d..a7cb80805993ed3248f1e52bd26dbee5e5a5b330 100644 (file)
@@ -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,
index 1dc8380144220bd2c37f5c6338ad9a38e1c641bf..05621748aead87cdb8127edc9e6b48309f503b2e 100644 (file)
@@ -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>
 
index 65dcf48a92fbc2bbc7e89fc8a5243c1bcec3eead..c6207db09f12850f02123525a07c0c025e08a55d 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <stddef.h>
 
index 1e2ba26029301ffd85e1a1803eea8b8f40f134e6..de6498dc4cbb3280ad557d7193c31c56442b00e3 100644 (file)
@@ -2,6 +2,7 @@
 #include "pmu.h"
 #include "util.h"
 #include "tests.h"
+#include <linux/kernel.h>
 
 /* Simulated format definitions. */
 static struct test_format {
index 5f23710b9fee62855de88f11f39e6054d12c9a27..73b5e47ef20b29c3b107b5aa2dac87c8f20e46c3 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdbool.h>
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 #include "util.h"
index ba36aac340bc7d6531eaeaace7ee40ee38851806..9adce112d255b1a1beb0cbdaa87447636ba09d46 100644 (file)
@@ -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;
index 4ea2ba861fc2fe6624fff3b67e2c0663015ff91d..d9350a1da48b46bbfaad0170e6ccb60a3f6f135b 100644 (file)
@@ -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
index 30498a2d4a6f73b338786a3ebc9c2a5c7fbe57b4..45df4a38811a41bcb872c7f18b22e889887f0376 100644 (file)
@@ -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;
index bc6bc7062eb4ffed74457bff52a5ab5c2d885300..27af9d62d899a9597824f6c6034f96caec24fae1 100644 (file)
@@ -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"
index 89ece244571363e780cf37434c66c156de923952..b7917519f6cc735b608f1ac5adacd9a340f6af12 100644 (file)
@@ -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>
index 42db00d78573ebe80c11b0977698769388eebc63..385c82e12473bf8e5ac5c615aa3867645bccb75c 100644 (file)
@@ -1,4 +1,5 @@
 #include <asm/bug.h>
+#include <linux/kernel.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include "symbol.h"
index 62bc4a86a970f8a7cda3cac3f7626e1014408027..c708395b3cb661933ed0357dfafd3528614870f7 100644 (file)
@@ -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 */
index 4d7e65fa9d86c66974c29b9002cf556a219c8a29..a0f59f69f46a01e8d984492b6dbbea86546ee80c 100644 (file)
@@ -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>
index 39942995f537cb0c118888897565536999b9a9d2..3fed4fb2e8663c33d0c19c6f0e5cd622e789e048 100644 (file)
@@ -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>
index 1d4ab53c60cae7b8075dd1bc3a0f1f37a3d9f08a..c56d52f90b54b064f9ed62957be9b3a1c9b777fe 100644 (file)
@@ -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"
index cb368306b12b7e023f1a2f3eb501529699f2fde6..d55092964da2f3fec32b61f6ef7906093d0945fe 100644 (file)
@@ -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"
index 4bd758553450c8904860d19dd642f790310bc591..1ffae42f76a1117eb9140ebf0e1a132aed2d657a 100644 (file)
@@ -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>
 
index 73f3ec1cf2a0f8bb4bb3b7d8bfe2cb39780251f1..13b9af1d1b454d3908e857c2243c42a1f8decf57 100644 (file)
@@ -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";
index 9b4d8ba22fed85f1f2bef6f5d47dc88cbb4df5d1..619e3eb44c50a91657255016743ebce96976d21f 100644 (file)
@@ -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>
index dcdb87a5d0a13a4698518e8a47b67bb4f76bfede..e8ce6abc53217d1fe13a77258f6290a0f53ad4b0 100644 (file)
@@ -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"