diff options
Diffstat (limited to 'tools/perf/util')
31 files changed, 41 insertions, 4 deletions
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 <errno.h> +#include <stdlib.h> #include <dwarf-regs.h> #include <linux/filter.h> 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 <linux/kernel.h> 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 <stdbool.h> #include <errno.h> #include <math.h> +#include <linux/string.h> #include <linux/zalloc.h> #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 <unistd.h> #include <sys/syscall.h> +#include <linux/string.h> 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 <linux/compiler.h> #include <linux/kernel.h> +#include <linux/string.h> #include <linux/zalloc.h> #include <sys/types.h> #include <sys/stat.h> 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 <linux/ctype.h> 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 <stdbool.h> -#include <string.h> #include <linux/compiler.h> -#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 <stdlib.h> #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 <elfutils/libdwfl.h> #include <elfutils/version.h> +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 <sys/utsname.h> #include <bpf/libbpf.h> #include <stdlib.h> +#include <string.h> 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 <linux/hash.h> #include <linux/log2.h> #include <linux/err.h> +#include <linux/string.h> #include <linux/zalloc.h> #include <perf/evlist.h> #include <perf/evsel.h> 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 <stdlib.h> // strtod() #define IN_EXPR_Y 1 #include "expr.h" #include "smt.h" +#include <assert.h> #include <string.h> #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 <math.h> #include <inttypes.h> #include <sys/param.h> +#include <linux/string.h> #include <linux/time64.h> #include <linux/zalloc.h> 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 <stdbool.h> #include <errno.h> #include <linux/kernel.h> +#include <linux/string.h> #include <linux/types.h> #include <linux/zalloc.h> 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 <stdio.h> #include <stdlib.h> #include <linux/err.h> +#include <linux/string.h> #include <linux/zalloc.h> #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 <string.h> #include <unistd.h> #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 <linux/ctype.h> #include <symbol/kallsyms.h> #include <linux/mman.h> +#include <linux/string.h> #include <linux/zalloc.h> 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 <subcmd/parse-options.h> #include "util/parse-branch-options.h" #include <stdlib.h> +#include <string.h> #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 <errno.h> #include <stdlib.h> +#include <string.h> #include <setjmp.h> #include <linux/err.h> #include <linux/kernel.h> 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 <linux/kernel.h> #include <linux/zalloc.h> #include <stdlib.h> +#include <string.h> 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 <linux/kernel.h> +#include <linux/string.h> 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 <linux/kernel.h> +#include <linux/string.h> #include <linux/zalloc.h> #include <errno.h> +#include <stdio.h> #include <stdlib.h> #include <unistd.h> 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 <linux/capability.h> #include <linux/kernel.h> #include <linux/mman.h> +#include <linux/string.h> #include <linux/time64.h> #include <sys/types.h> #include <sys/stat.h> 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 <pwd.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <linux/kernel.h> +#include <linux/string.h> 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 <linux/zalloc.h> #include <errno.h> #include <stdlib.h> +#include <string.h> #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 <api/fs/fs.h> #include <sys/mman.h> 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 <inttypes.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include <linux/zalloc.h> 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 <fcntl.h> #include <stdio.h> +#include <string.h> #include <unistd.h> #include <sys/stat.h> #include <sys/mman.h> |