diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-04 10:21:24 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-09 09:13:22 -0400 |
commit | 215a0d305c5651928eb67c96bcedd0a6c297dfce (patch) | |
tree | ce435a95163b78acc5290ed272311fe261cd240c | |
parent | fc50e0ba9bcac92ff177ff3ac64644108b6d8dd8 (diff) |
perf tools: Add missing headers, mostly stdlib.h
Part of the erosion of util/util.h, that will lose its include stdlib.h,
we need to add it to places where it is needed but was getting it
indirectly.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-1imnqezw99ahc07fjeb51qby@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
26 files changed, 35 insertions, 7 deletions
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c index f3824ca7c20b..1bc329412bcf 100644 --- a/tools/perf/arch/common.c +++ b/tools/perf/arch/common.c | |||
@@ -1,5 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | ||
3 | #include "common.h" | 4 | #include "common.h" |
4 | #include "../util/env.h" | 5 | #include "../util/env.h" |
5 | #include "../util/util.h" | 6 | #include "../util/util.h" |
diff --git a/tools/perf/arch/powerpc/util/perf_regs.c b/tools/perf/arch/powerpc/util/perf_regs.c index 34d5134681d9..64f65c296d3e 100644 --- a/tools/perf/arch/powerpc/util/perf_regs.c +++ b/tools/perf/arch/powerpc/util/perf_regs.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include "../../util/perf_regs.h" | 8 | #include "../../util/perf_regs.h" |
9 | #include "../../util/debug.h" | 9 | #include "../../util/debug.h" |
10 | 10 | ||
11 | #include <linux/kernel.h> | ||
12 | |||
11 | const struct sample_reg sample_reg_masks[] = { | 13 | const struct sample_reg sample_reg_masks[] = { |
12 | SMPL_REG(r0, PERF_REG_POWERPC_R0), | 14 | SMPL_REG(r0, PERF_REG_POWERPC_R0), |
13 | SMPL_REG(r1, PERF_REG_POWERPC_R1), | 15 | SMPL_REG(r1, PERF_REG_POWERPC_R1), |
diff --git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c index a25896135abe..165c51435e72 100644 --- a/tools/perf/arch/s390/util/header.c +++ b/tools/perf/arch/s390/util/header.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <stdio.h> | 12 | #include <stdio.h> |
13 | #include <string.h> | 13 | #include <string.h> |
14 | #include <linux/ctype.h> | 14 | #include <linux/ctype.h> |
15 | #include <linux/kernel.h> | ||
15 | 16 | ||
16 | #include "../../util/header.h" | 17 | #include "../../util/header.h" |
17 | #include "../../util/util.h" | 18 | #include "../../util/util.h" |
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c index d76f831f94c7..6c1284c87aaa 100644 --- a/tools/perf/builtin-config.c +++ b/tools/perf/builtin-config.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "util/debug.h" | 15 | #include "util/debug.h" |
16 | #include "util/config.h" | 16 | #include "util/config.h" |
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | #include <stdlib.h> | ||
18 | 19 | ||
19 | static bool use_system_config, use_user_config; | 20 | static bool use_system_config, use_user_config; |
20 | 21 | ||
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 3d29d0524a89..6a1cab547043 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <errno.h> | 17 | #include <errno.h> |
18 | #include <stdio.h> | 18 | #include <stdio.h> |
19 | #include <stdlib.h> | ||
19 | #include <sys/types.h> | 20 | #include <sys/types.h> |
20 | #include <sys/stat.h> | 21 | #include <sys/stat.h> |
21 | #include <unistd.h> | 22 | #include <unistd.h> |
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c index a039f93199e5..ca5a5f94ce79 100644 --- a/tools/perf/tests/llvm.c +++ b/tools/perf/tests/llvm.c | |||
@@ -1,5 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | ||
3 | #include <bpf/libbpf.h> | 4 | #include <bpf/libbpf.h> |
4 | #include <util/llvm-utils.h> | 5 | #include <util/llvm-utils.h> |
5 | #include <util/cache.h> | 6 | #include <util/cache.h> |
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index 236ce0d6c826..361714e2583c 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c | |||
@@ -1,6 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | #include <stdlib.h> | ||
4 | #include <linux/bitops.h> | 5 | #include <linux/bitops.h> |
5 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
6 | #include <linux/types.h> | 7 | #include <linux/types.h> |
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c index f101576d1c72..5e8834fc7dec 100644 --- a/tools/perf/tests/vmlinux-kallsyms.c +++ b/tools/perf/tests/vmlinux-kallsyms.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/rbtree.h> | 3 | #include <linux/rbtree.h> |
4 | #include <inttypes.h> | 4 | #include <inttypes.h> |
5 | #include <string.h> | 5 | #include <string.h> |
6 | #include <stdlib.h> | ||
6 | #include "map.h" | 7 | #include "map.h" |
7 | #include "symbol.h" | 8 | #include "symbol.h" |
8 | #include "util.h" | 9 | #include "util.h" |
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h index aa5932e1d62e..dc1444136658 100644 --- a/tools/perf/ui/browser.h +++ b/tools/perf/ui/browser.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <stdarg.h> | 6 | #include <stdarg.h> |
7 | #include <sys/types.h> | ||
7 | 8 | ||
8 | #define HE_COLORSET_TOP 50 | 9 | #define HE_COLORSET_TOP 50 |
9 | #define HE_COLORSET_MEDIUM 51 | 10 | #define HE_COLORSET_MEDIUM 51 |
diff --git a/tools/perf/ui/browsers/map.c b/tools/perf/ui/browsers/map.c index 5f6529c9eb8e..4c545b92e20d 100644 --- a/tools/perf/ui/browsers/map.c +++ b/tools/perf/ui/browsers/map.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <elf.h> | 2 | #include <elf.h> |
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | #include <sys/ttydefaults.h> | 4 | #include <sys/ttydefaults.h> |
5 | #include <stdlib.h> | ||
5 | #include <string.h> | 6 | #include <string.h> |
6 | #include <linux/bitops.h> | 7 | #include <linux/bitops.h> |
7 | #include "../../util/util.h" | 8 | #include "../../util/util.h" |
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c index d4ac41679721..3ad0d3363ac6 100644 --- a/tools/perf/ui/tui/setup.c +++ b/tools/perf/ui/tui/setup.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <errno.h> | 2 | #include <errno.h> |
3 | #include <signal.h> | 3 | #include <signal.h> |
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include <stdlib.h> | ||
5 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
6 | #ifdef HAVE_BACKTRACE_SUPPORT | 7 | #ifdef HAVE_BACKTRACE_SUPPORT |
7 | #include <execinfo.h> | 8 | #include <execinfo.h> |
diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c index b9794d6185af..fe5e571816fc 100644 --- a/tools/perf/ui/tui/util.c +++ b/tools/perf/ui/tui/util.c | |||
@@ -1,8 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "../../util/util.h" | ||
3 | #include <signal.h> | 2 | #include <signal.h> |
4 | #include <stdbool.h> | 3 | #include <stdbool.h> |
5 | #include <string.h> | 4 | #include <string.h> |
5 | #include <stdlib.h> | ||
6 | #include <sys/ttydefaults.h> | 6 | #include <sys/ttydefaults.h> |
7 | 7 | ||
8 | #include "../../util/cache.h" | 8 | #include "../../util/cache.h" |
diff --git a/tools/perf/util/cputopo.c b/tools/perf/util/cputopo.c index 26e73a4bd4fe..d3b2bd258b9e 100644 --- a/tools/perf/util/cputopo.c +++ b/tools/perf/util/cputopo.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <sys/param.h> | 2 | #include <sys/param.h> |
3 | #include <sys/utsname.h> | 3 | #include <sys/utsname.h> |
4 | #include <inttypes.h> | 4 | #include <inttypes.h> |
5 | #include <stdlib.h> | ||
5 | #include <api/fs/fs.h> | 6 | #include <api/fs/fs.h> |
6 | 7 | ||
7 | #include "cputopo.h" | 8 | #include "cputopo.h" |
diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index 2182f552aac6..4cdd1f579156 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c | |||
@@ -5,6 +5,7 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <errno.h> | 7 | #include <errno.h> |
8 | #include <stdlib.h> | ||
8 | 9 | ||
9 | #include "evsel.h" | 10 | #include "evsel.h" |
10 | #include "machine.h" | 11 | #include "machine.h" |
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index 3cc578343f48..3780fe42453b 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <string.h> | 7 | #include <string.h> |
8 | #include <stdarg.h> | 8 | #include <stdarg.h> |
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | #include <stdlib.h> | ||
10 | #include <sys/wait.h> | 11 | #include <sys/wait.h> |
11 | #include <api/debug.h> | 12 | #include <api/debug.h> |
12 | #include <linux/time64.h> | 13 | #include <linux/time64.h> |
diff --git a/tools/perf/util/demangle-java.c b/tools/perf/util/demangle-java.c index 5b4900d67c80..763328c151e9 100644 --- a/tools/perf/util/demangle-java.c +++ b/tools/perf/util/demangle-java.c | |||
@@ -1,14 +1,15 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <sys/types.h> | 2 | #include <sys/types.h> |
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <stdlib.h> | ||
4 | #include <string.h> | 5 | #include <string.h> |
5 | #include "util.h" | ||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | #include "symbol.h" | 7 | #include "symbol.h" |
8 | 8 | ||
9 | #include "demangle-java.h" | 9 | #include "demangle-java.h" |
10 | 10 | ||
11 | #include <linux/ctype.h> | 11 | #include <linux/ctype.h> |
12 | #include <linux/kernel.h> | ||
12 | 13 | ||
13 | enum { | 14 | enum { |
14 | MODE_PREFIX = 0, | 15 | MODE_PREFIX = 0, |
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index 218bfea8f8a8..03b2de1f5a35 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <errno.h> | 6 | #include <errno.h> |
7 | #include <inttypes.h> | 7 | #include <inttypes.h> |
8 | #include <stdbool.h> | 8 | #include <stdbool.h> |
9 | #include "util.h" | 9 | #include <stdlib.h> |
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | #include "dwarf-aux.h" | 11 | #include "dwarf-aux.h" |
12 | #include "string2.h" | 12 | #include "string2.h" |
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index 22eee8942527..7d317d49d207 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <errno.h> | 7 | #include <errno.h> |
8 | #include <sys/utsname.h> | 8 | #include <sys/utsname.h> |
9 | #include <bpf/libbpf.h> | 9 | #include <bpf/libbpf.h> |
10 | #include <stdlib.h> | ||
10 | 11 | ||
11 | struct perf_env perf_env; | 12 | struct perf_env perf_env; |
12 | 13 | ||
diff --git a/tools/perf/util/parse-branch-options.c b/tools/perf/util/parse-branch-options.c index bd779d9f4d1e..726e8d9e8c54 100644 --- a/tools/perf/util/parse-branch-options.c +++ b/tools/perf/util/parse-branch-options.c | |||
@@ -1,9 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "perf.h" | 2 | #include "perf.h" |
3 | #include "util/util.h" | ||
4 | #include "util/debug.h" | 3 | #include "util/debug.h" |
5 | #include <subcmd/parse-options.h> | 4 | #include <subcmd/parse-options.h> |
6 | #include "util/parse-branch-options.h" | 5 | #include "util/parse-branch-options.h" |
6 | #include <stdlib.h> | ||
7 | 7 | ||
8 | #define BRANCH_OPT(n, m) \ | 8 | #define BRANCH_OPT(n, m) \ |
9 | { .name = n, .mode = (m) } | 9 | { .name = n, .mode = (m) } |
diff --git a/tools/perf/util/parse-regs-options.c b/tools/perf/util/parse-regs-options.c index 08581e276225..ef46c2848808 100644 --- a/tools/perf/util/parse-regs-options.c +++ b/tools/perf/util/parse-regs-options.c | |||
@@ -1,8 +1,12 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "perf.h" | 2 | #include <stdbool.h> |
3 | #include "util/util.h" | 3 | #include <stdlib.h> |
4 | #include <stdint.h> | ||
5 | #include <string.h> | ||
6 | #include <stdio.h> | ||
4 | #include "util/debug.h" | 7 | #include "util/debug.h" |
5 | #include <subcmd/parse-options.h> | 8 | #include <subcmd/parse-options.h> |
9 | #include "util/perf_regs.h" | ||
6 | #include "util/parse-regs-options.h" | 10 | #include "util/parse-regs-options.h" |
7 | 11 | ||
8 | static int | 12 | static int |
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index 23092fd6451d..54336df089df 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "util.h" | 3 | #include "util.h" |
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <errno.h> | 5 | #include <errno.h> |
6 | #include <stdlib.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Used as the default ->buf value, so that people can always assume | 9 | * Used as the default ->buf value, so that people can always assume |
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 62008756d8cc..429920978cb0 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <fcntl.h> | 2 | #include <fcntl.h> |
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <errno.h> | 4 | #include <errno.h> |
5 | #include <stdlib.h> | ||
5 | #include <string.h> | 6 | #include <string.h> |
6 | #include <unistd.h> | 7 | #include <unistd.h> |
7 | #include <inttypes.h> | 8 | #include <inttypes.h> |
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c index 17edbd4f6f85..c8b7cadbc9c4 100644 --- a/tools/perf/util/symbol-minimal.c +++ b/tools/perf/util/symbol-minimal.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <fcntl.h> | 8 | #include <fcntl.h> |
9 | #include <string.h> | 9 | #include <string.h> |
10 | #include <stdlib.h> | ||
10 | #include <byteswap.h> | 11 | #include <byteswap.h> |
11 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
12 | 13 | ||
diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c index 3852d07c49bd..3adc65480349 100644 --- a/tools/perf/util/target.c +++ b/tools/perf/util/target.c | |||
@@ -10,9 +10,9 @@ | |||
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | #include <pwd.h> | 12 | #include <pwd.h> |
13 | #include <stdlib.h> | ||
13 | #include <string.h> | 14 | #include <string.h> |
14 | 15 | ||
15 | |||
16 | enum target_errno target__validate(struct target *target) | 16 | enum target_errno target__validate(struct target *target) |
17 | { | 17 | { |
18 | enum target_errno ret = TARGET_ERRNO__SUCCESS; | 18 | enum target_errno ret = TARGET_ERRNO__SUCCESS; |
diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c index 6ff1ff4d4ce7..48d585a0175c 100644 --- a/tools/perf/util/thread-stack.c +++ b/tools/perf/util/thread-stack.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | #include <linux/log2.h> | 9 | #include <linux/log2.h> |
10 | #include <errno.h> | 10 | #include <errno.h> |
11 | #include <stdlib.h> | ||
11 | #include "thread.h" | 12 | #include "thread.h" |
12 | #include "event.h" | 13 | #include "event.h" |
13 | #include "machine.h" | 14 | #include "machine.h" |
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index 070d25ceea6a..3949a60b00ae 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c | |||
@@ -9,6 +9,9 @@ | |||
9 | */ | 9 | */ |
10 | #include "util.h" | 10 | #include "util.h" |
11 | #include "debug.h" | 11 | #include "debug.h" |
12 | #include <stdio.h> | ||
13 | #include <stdlib.h> | ||
14 | #include <linux/compiler.h> | ||
12 | 15 | ||
13 | static __noreturn void usage_builtin(const char *err) | 16 | static __noreturn void usage_builtin(const char *err) |
14 | { | 17 | { |