From 8520a98dbab61e9e340cdfb72dd17ccc8a98961e Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 29 Aug 2019 16:18:59 -0300 Subject: perf debug: Remove needless include directives from debug.h All we need there is a forward declaration for 'union perf_event', so remove it from there and add missing header directives in places using things from this indirect include. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-7ftk0ztstqub1tirjj8o8xbl@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf-prologue.c | 1 + tools/perf/util/branch.c | 1 + tools/perf/util/callchain.c | 1 + tools/perf/util/cloexec.c | 2 ++ tools/perf/util/data.c | 1 + tools/perf/util/debug.c | 1 + tools/perf/util/debug.h | 6 ++---- tools/perf/util/dwarf-aux.c | 1 + tools/perf/util/dwarf-aux.h | 2 ++ tools/perf/util/env.c | 1 + tools/perf/util/evlist.c | 1 + tools/perf/util/expr.y | 2 ++ tools/perf/util/hist.c | 1 + tools/perf/util/intel-pt.c | 1 + tools/perf/util/llvm-utils.c | 1 + tools/perf/util/lzma.c | 1 + tools/perf/util/machine.c | 1 + tools/perf/util/map.c | 1 + tools/perf/util/ordered-events.c | 1 + tools/perf/util/parse-branch-options.c | 2 ++ tools/perf/util/perf-hooks.c | 1 + tools/perf/util/probe-finder.c | 1 + tools/perf/util/pstack.c | 1 + tools/perf/util/sort.c | 1 + tools/perf/util/strbuf.c | 4 ++++ tools/perf/util/symbol.c | 1 + tools/perf/util/target.c | 3 +++ tools/perf/util/thread-stack.c | 1 + tools/perf/util/util.c | 1 + tools/perf/util/values.c | 1 + tools/perf/util/zlib.c | 1 + 31 files changed, 41 insertions(+), 4 deletions(-) (limited to 'tools/perf/util') diff --git a/tools/perf/util/bpf-prologue.c b/tools/perf/util/bpf-prologue.c index 09e6c76e1c3b..b020a8678eb9 100644 --- a/tools/perf/util/bpf-prologue.c +++ b/tools/perf/util/bpf-prologue.c @@ -13,6 +13,7 @@ #include "bpf-prologue.h" #include "probe-finder.h" #include +#include #include #include diff --git a/tools/perf/util/branch.c b/tools/perf/util/branch.c index 02d6d839ff24..30642e1f2b1b 100644 --- a/tools/perf/util/branch.c +++ b/tools/perf/util/branch.c @@ -1,6 +1,7 @@ #include "util/util.h" #include "util/debug.h" #include "util/branch.h" +#include static bool cross_area(u64 addr1, u64 addr2, int size) { diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index a47d0e8c2434..76bf05b26d3b 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "asm/bug.h" diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c index 92d08198e64a..4e904fcb2783 100644 --- a/tools/perf/util/cloexec.c +++ b/tools/perf/util/cloexec.c @@ -4,10 +4,12 @@ #include "util.h" #include "../perf-sys.h" #include "cloexec.h" +#include "event.h" #include "asm/bug.h" #include "debug.h" #include #include +#include static unsigned long flag = PERF_FLAG_FD_CLOEXEC; diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 74aafe0df506..e75c3a279fe8 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index c822c5943340..522887ee4c02 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c @@ -19,6 +19,7 @@ #include "print_binary.h" #include "util.h" #include "target.h" +#include "ui/helpline.h" #include diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h index 77445dfc5c7d..b2deee987ffa 100644 --- a/tools/perf/util/debug.h +++ b/tools/perf/util/debug.h @@ -4,11 +4,7 @@ #define __PERF_DEBUG_H #include -#include #include -#include "event.h" -#include "../ui/helpline.h" -#include "../ui/progress.h" #include "../ui/util.h" extern int verbose; @@ -42,6 +38,8 @@ extern int debug_data_convert; #define STRERR_BUFSIZE 128 /* For the buffer size of str_error_r */ +union perf_event; + int dump_printf(const char *fmt, ...) __printf(1, 2); void trace_event(union perf_event *event); diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index 03b2de1f5a35..df6cee5c071f 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -9,6 +9,7 @@ #include #include "debug.h" #include "dwarf-aux.h" +#include "strbuf.h" #include "string2.h" /** diff --git a/tools/perf/util/dwarf-aux.h b/tools/perf/util/dwarf-aux.h index 0489b0cf8e2c..f204e5892403 100644 --- a/tools/perf/util/dwarf-aux.h +++ b/tools/perf/util/dwarf-aux.h @@ -10,6 +10,8 @@ #include #include +struct strbuf; + /* Find the realpath of the target file */ const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname); diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index 571efb4f0351..3baca06786fb 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -9,6 +9,7 @@ #include #include #include +#include struct perf_env perf_env; diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 71b231c7097f..b5d6d6ec9a9b 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y index 432b8560cf51..f9a20a39b64a 100644 --- a/tools/perf/util/expr.y +++ b/tools/perf/util/expr.y @@ -2,9 +2,11 @@ %{ #include "util.h" #include "util/debug.h" +#include // strtod() #define IN_EXPR_Y 1 #include "expr.h" #include "smt.h" +#include #include #define MAXIDLEN 256 diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index adae4134e972..02ea2ee62814 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 825e3690940d..9b56fb74bedf 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c index 9f0470ecbca9..55fb4b3b1157 100644 --- a/tools/perf/util/llvm-utils.c +++ b/tools/perf/util/llvm-utils.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "debug.h" #include "llvm-utils.h" diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c index b1dd29a9d915..397447066033 100644 --- a/tools/perf/util/lzma.c +++ b/tools/perf/util/lzma.c @@ -9,6 +9,7 @@ #include "compress.h" #include "util.h" #include "debug.h" +#include #include #define BUFSIZE 8192 diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index a1542b4c047b..6e9afe4e55dd 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -30,6 +30,7 @@ #include #include #include +#include #include static void __machine__remove_thread(struct machine *machine, struct thread *th, bool lock); diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 27b7b102e4a2..c75b20b93820 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -20,6 +20,7 @@ #include "namespaces.h" #include "unwind.h" #include "srccode.h" +#include "ui/ui.h" static void __maps__insert(struct maps *maps, struct map *map); static void __maps__insert_name(struct maps *maps, struct map *map); diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index bb5f34b7ab44..359db2b1fcef 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -8,6 +8,7 @@ #include "session.h" #include "asm/bug.h" #include "debug.h" +#include "ui/progress.h" #define pr_N(n, fmt, ...) \ eprintf(n, debug_ordered_events, fmt, ##__VA_ARGS__) diff --git a/tools/perf/util/parse-branch-options.c b/tools/perf/util/parse-branch-options.c index 1430437b9d51..bb4aa88c50a8 100644 --- a/tools/perf/util/parse-branch-options.c +++ b/tools/perf/util/parse-branch-options.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 #include "util/debug.h" +#include "util/event.h" #include #include "util/parse-branch-options.h" #include +#include #define BRANCH_OPT(n, m) \ { .name = n, .mode = (m) } diff --git a/tools/perf/util/perf-hooks.c b/tools/perf/util/perf-hooks.c index 4f3aa8d99ef4..e635c594f773 100644 --- a/tools/perf/util/perf-hooks.c +++ b/tools/perf/util/perf-hooks.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 025fc4491993..505905fc21c5 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -24,6 +24,7 @@ #include "dso.h" #include "debug.h" #include "intlist.h" +#include "strbuf.h" #include "strlist.h" #include "symbol.h" #include "probe-finder.h" diff --git a/tools/perf/util/pstack.c b/tools/perf/util/pstack.c index 28de8a4c2ce8..80ff41fc45be 100644 --- a/tools/perf/util/pstack.c +++ b/tools/perf/util/pstack.c @@ -10,6 +10,7 @@ #include #include #include +#include struct pstack { unsigned short top; diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 23d0ab7c801c..035355a9945e 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -22,6 +22,7 @@ #include "annotate.h" #include "time-utils.h" #include +#include regex_t parent_regex; const char default_parent_pattern[] = "^sys_|^do_page_fault"; diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index 0afdbf38a2b2..a64a37628f12 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c @@ -1,8 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 +#include "cache.h" #include "debug.h" +#include "strbuf.h" #include +#include #include #include +#include #include #include diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 035f2e75728c..c37cca690864 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c index 3adc65480349..565f7aef7e6c 100644 --- a/tools/perf/util/target.c +++ b/tools/perf/util/target.c @@ -10,8 +10,11 @@ #include "debug.h" #include +#include #include #include +#include +#include enum target_errno target__validate(struct target *target) { diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c index 15134ac9b8f1..cd8a948d03ec 100644 --- a/tools/perf/util/thread-stack.c +++ b/tools/perf/util/thread-stack.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "thread.h" #include "event.h" #include "machine.h" diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 607daec22943..32322a20a68b 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "util.h" #include "debug.h" +#include "event.h" #include "namespaces.h" #include #include diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c index c59154e2d124..b9823f414f10 100644 --- a/tools/perf/util/values.c +++ b/tools/perf/util/values.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c index 512ad7c09b13..59d456f716e9 100644 --- a/tools/perf/util/zlib.c +++ b/tools/perf/util/zlib.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include -- cgit v1.2.3