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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent fc50e0ba
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "common.h" #include "common.h"
#include "../util/env.h" #include "../util/env.h"
#include "../util/util.h" #include "../util/util.h"
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "../../util/perf_regs.h" #include "../../util/perf_regs.h"
#include "../../util/debug.h" #include "../../util/debug.h"
#include <linux/kernel.h>
const struct sample_reg sample_reg_masks[] = { const struct sample_reg sample_reg_masks[] = {
SMPL_REG(r0, PERF_REG_POWERPC_R0), SMPL_REG(r0, PERF_REG_POWERPC_R0),
SMPL_REG(r1, PERF_REG_POWERPC_R1), SMPL_REG(r1, PERF_REG_POWERPC_R1),
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/kernel.h>
#include "../../util/header.h" #include "../../util/header.h"
#include "../../util/util.h" #include "../../util/util.h"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "util/debug.h" #include "util/debug.h"
#include "util/config.h" #include "util/config.h"
#include <linux/string.h> #include <linux/string.h>
#include <stdlib.h>
static bool use_system_config, use_user_config; static bool use_system_config, use_user_config;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <bpf/libbpf.h> #include <bpf/libbpf.h>
#include <util/llvm-utils.h> #include <util/llvm-utils.h>
#include <util/cache.h> #include <util/cache.h>
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <stdbool.h> #include <stdbool.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdlib.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <inttypes.h> #include <inttypes.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include "map.h" #include "map.h"
#include "symbol.h" #include "symbol.h"
#include "util.h" #include "util.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/types.h>
#define HE_COLORSET_TOP 50 #define HE_COLORSET_TOP 50
#define HE_COLORSET_MEDIUM 51 #define HE_COLORSET_MEDIUM 51
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <elf.h> #include <elf.h>
#include <inttypes.h> #include <inttypes.h>
#include <sys/ttydefaults.h> #include <sys/ttydefaults.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include "../../util/util.h" #include "../../util/util.h"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#ifdef HAVE_BACKTRACE_SUPPORT #ifdef HAVE_BACKTRACE_SUPPORT
#include <execinfo.h> #include <execinfo.h>
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include "../../util/util.h"
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include <sys/ttydefaults.h> #include <sys/ttydefaults.h>
#include "../../util/cache.h" #include "../../util/cache.h"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdlib.h>
#include <api/fs/fs.h> #include <api/fs/fs.h>
#include "cputopo.h" #include "cputopo.h"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
#include <errno.h> #include <errno.h>
#include <stdlib.h>
#include "evsel.h" #include "evsel.h"
#include "machine.h" #include "machine.h"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <api/debug.h> #include <api/debug.h>
#include <linux/time64.h> #include <linux/time64.h>
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h"
#include "debug.h" #include "debug.h"
#include "symbol.h" #include "symbol.h"
#include "demangle-java.h" #include "demangle-java.h"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/kernel.h>
enum { enum {
MODE_PREFIX = 0, MODE_PREFIX = 0,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <errno.h> #include <errno.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>
#include "util.h" #include <stdlib.h>
#include "debug.h" #include "debug.h"
#include "dwarf-aux.h" #include "dwarf-aux.h"
#include "string2.h" #include "string2.h"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <errno.h> #include <errno.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <bpf/libbpf.h> #include <bpf/libbpf.h>
#include <stdlib.h>
struct perf_env perf_env; struct perf_env perf_env;
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include "perf.h" #include "perf.h"
#include "util/util.h"
#include "util/debug.h" #include "util/debug.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "util/parse-branch-options.h" #include "util/parse-branch-options.h"
#include <stdlib.h>
#define BRANCH_OPT(n, m) \ #define BRANCH_OPT(n, m) \
{ .name = n, .mode = (m) } { .name = n, .mode = (m) }
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include "perf.h" #include <stdbool.h>
#include "util/util.h" #include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "util/debug.h" #include "util/debug.h"
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "util/perf_regs.h"
#include "util/parse-regs-options.h" #include "util/parse-regs-options.h"
static int static int
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "util.h" #include "util.h"
#include <linux/kernel.h> #include <linux/kernel.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h>
/* /*
* Used as the default ->buf value, so that people can always assume * Used as the default ->buf value, so that people can always assume
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <inttypes.h> #include <inttypes.h>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include <byteswap.h> #include <byteswap.h>
#include <sys/stat.h> #include <sys/stat.h>
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
#include "debug.h" #include "debug.h"
#include <pwd.h> #include <pwd.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
enum target_errno target__validate(struct target *target) enum target_errno target__validate(struct target *target)
{ {
enum target_errno ret = TARGET_ERRNO__SUCCESS; enum target_errno ret = TARGET_ERRNO__SUCCESS;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/log2.h> #include <linux/log2.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h>
#include "thread.h" #include "thread.h"
#include "event.h" #include "event.h"
#include "machine.h" #include "machine.h"
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
*/ */
#include "util.h" #include "util.h"
#include "debug.h" #include "debug.h"
#include <stdio.h>
#include <stdlib.h>
#include <linux/compiler.h>
static __noreturn void usage_builtin(const char *err) static __noreturn void usage_builtin(const char *err)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment