perf tools: Remove string.h, unistd.h and sys/stat.h from util.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Apr 2017 23:57:47 +0000 (20:57 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 24 Apr 2017 16:43:33 +0000 (13:43 -0300)
Not needed in this header, added to the places that need FILE,
putchar(), access() and a few other prototypes.

Link: http://lkml.kernel.org/n/tip-xxtdsl6nsna82j7puwbdjqhs@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
25 files changed:
tools/lib/subcmd/help.h
tools/perf/arch/arm/util/cs-etm.c
tools/perf/arch/arm64/util/dwarf-regs.c
tools/perf/builtin-help.c
tools/perf/builtin-mem.c
tools/perf/builtin-report.c
tools/perf/builtin-script.c
tools/perf/builtin-stat.c
tools/perf/builtin-version.c
tools/perf/perf.c
tools/perf/tests/attr.c
tools/perf/tests/bpf.c
tools/perf/tests/parse-events.c
tools/perf/util/build-id.c
tools/perf/util/color.h
tools/perf/util/config.c
tools/perf/util/dso.c
tools/perf/util/event.c
tools/perf/util/header.c
tools/perf/util/machine.c
tools/perf/util/pmu.c
tools/perf/util/probe-file.c
tools/perf/util/strlist.c
tools/perf/util/util.c
tools/perf/util/util.h

index e145a020780c0d5dc03c39b60205bb7d782dfcf7..9bd4223dc722013bbfd170d652064f5b056cc07d 100644 (file)
@@ -2,6 +2,7 @@
 #define __SUBCMD_HELP_H
 
 #include <sys/types.h>
+#include <stdio.h>
 
 struct cmdnames {
        size_t alloc;
index dfea6b6355254e0eac677dfc05dcce0463089f6e..29361d9b635a67ec323d4e6470b20b8e6ef3e385 100644 (file)
@@ -33,6 +33,7 @@
 #include "../../util/cs-etm.h"
 
 #include <stdlib.h>
+#include <sys/stat.h>
 
 #define ENABLE_SINK_MAX        128
 #define CS_BUS_DEVICE_PATH "/bus/coresight/devices/"
index f268720ff0211d91fe6d8bd57fc0377009fb6366..cd764a9fd0983de57e02feca3967dd1e5e2504d2 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <errno.h>
 #include <stddef.h>
+#include <string.h>
 #include <dwarf-regs.h>
 #include <linux/ptrace.h> /* for struct user_pt_regs */
 #include <linux/stringify.h>
index 7bde2f59dac2158340c449fe6eb4bf085fcb87d7..492f8e14ab09826f15f58023bb721206fbb9cc8f 100644 (file)
 #include "util/debug.h"
 #include <linux/kernel.h>
 #include <errno.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 static struct man_viewer_list {
        struct man_viewer_list *next;
index 1ebc67390898f504ee206a28b7b0d77bc9e454d5..2e5be1d63af6e7eefc5f5ec0ff05dc4802ac52cf 100644 (file)
@@ -1,4 +1,7 @@
 #include <inttypes.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "builtin.h"
 #include "perf.h"
 
index 3f89e0eaf0d485bb8e9522d21b50bb36e0a7887f..22478ff2b706ad1b9fc15c6fe13e341b98af10e5 100644 (file)
@@ -46,6 +46,9 @@
 #include <signal.h>
 #include <linux/bitmap.h>
 #include <linux/stringify.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 struct report {
        struct perf_tool        tool;
index b093a3c21e40590d12c236f1696258e9a43d69e4..d05aec491cff22189d7fe763120884a639cd2cfb 100644 (file)
@@ -37,6 +37,9 @@
 #include <inttypes.h>
 #include <signal.h>
 #include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "sane_ctype.h"
 
index e3837febb4ffb796e55fdf3349ad95de3218e92d..eb3cc0b9a9e4446a2d38f85545c7f571c52bdb86 100644 (file)
@@ -76,6 +76,9 @@
 #include <inttypes.h>
 #include <locale.h>
 #include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "sane_ctype.h"
 
index b9a095b1db99b66f018714ff83b833d9f448325d..d25149456a2fc336b5d817c2d80c86d73cb06503 100644 (file)
@@ -1,6 +1,7 @@
-#include "util/util.h"
 #include "builtin.h"
 #include "perf.h"
+#include <linux/compiler.h>
+#include <stdio.h>
 
 int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused)
 {
index 0b2cad0fb3f9e2bb5150f45384859eee1a968121..4cc6960f6226289926dcee7f60ba0a6c7796332b 100644 (file)
@@ -24,6 +24,9 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <linux/kernel.h>
 
 const char perf_usage_string[] =
index c19e0da543374b2c4afeb76d56446cfac53547a0..0dd77494bb58e62620b0ad21843c95add77e5bfa 100644 (file)
@@ -25,6 +25,9 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "../perf.h"
 #include "util.h"
 #include <subcmd/exec-cmd.h>
index b78fbd611a7c568be74e3770cdf154eb9fe19692..5876da126b584febb15b128fb28baac1b30baac9 100644 (file)
@@ -1,6 +1,8 @@
 #include <errno.h>
 #include <stdio.h>
 #include <sys/epoll.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <util/util.h>
 #include <util/bpf-loader.h>
 #include <util/evlist.h>
index 981d2bf9914f12bd2dc754c6c0cb5f0f6736dfc6..7fad885491c5710acb1e1d82e290d5a34639f88e 100644 (file)
@@ -7,6 +7,9 @@
 #include "util.h"
 #include <dirent.h>
 #include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <linux/kernel.h>
 #include <linux/hw_breakpoint.h>
 #include <api/fs/fs.h>
index 923ea290bb6e3fa9bc455fa3584ec084d1099202..687b5add4bde3cb087cf976470001ee89ca6ee1d 100644 (file)
@@ -10,6 +10,8 @@
 #include <dirent.h>
 #include <errno.h>
 #include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include "build-id.h"
 #include "event.h"
 #include "symbol.h"
index a93997f16dec3b2b9815e4bf298a0928a52f4a1a..52122bcc31701fef202cbdb95e5502841def750c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __PERF_COLOR_H
 #define __PERF_COLOR_H
 
+#include <stdio.h>
+
 /* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
 #define COLOR_MAXLEN 24
 
index 07d87d2dbee7b113614b0300b1c153ad30132922..8d724f0fa5a81f09ac2547010179ad60f1ed39fd 100644 (file)
@@ -16,6 +16,9 @@
 #include "util/hist.h"  /* perf_hist_config */
 #include "util/llvm-utils.h"   /* perf_llvm_config */
 #include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "sane_ctype.h"
 
index 3339ab7cabc51d7de8f1391e5ccf480d814044e3..a96a99d2369f800634025bcdfa9838d1d6bc9d97 100644 (file)
@@ -2,6 +2,9 @@
 #include <linux/kernel.h>
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <errno.h>
 #include "compress.h"
 #include "path.h"
index cf457ef534dad6e62ea3f3b2b441ad249d178e46..2e829ac0f615c3f8a31338d3b89b7bbeced5fb91 100644 (file)
@@ -3,6 +3,9 @@
 #include <inttypes.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
 #include <api/fs/fs.h>
 #include "event.h"
index 915bc4f3948240a4d4b535474ece8043f1d74cb5..948b2c5efb658e419114680ff07f4bf32cd70871 100644 (file)
 #include <linux/list.h>
 #include <linux/kernel.h>
 #include <linux/bitops.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <sys/utsname.h>
+#include <unistd.h>
 
 #include "evlist.h"
 #include "evsel.h"
index 988e84ce6f8847425bc45dd13603233104d12e0e..7a47f52ccfccf5de627f023e78ee554359639224 100644 (file)
@@ -14,6 +14,9 @@
 #include "thread.h"
 #include "vdso.h"
 #include <stdbool.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "unwind.h"
 #include "linux/hash.h"
 #include "asm/bug.h"
index bca1844594d0028daea56d6dac42311ef9e6e14b..ac16a9db1fb566ca14d272e33bc34e5166ea2b81 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/compiler.h>
 #include <sys/types.h>
 #include <errno.h>
+#include <sys/stat.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdbool.h>
index 685653f2bc320a39c855e9c38af9e1a219274891..d679389e627c1800c58b6b632ef65e67ff49d771 100644 (file)
  *
  */
 #include <errno.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <sys/uio.h>
+#include <unistd.h>
 #include "util.h"
 #include "event.h"
 #include "strlist.h"
index 0d3dfcb919b44936dfa42f2f437176f833afa39c..9de5434bb49ea355c25358c5441290b28ea0fb60 100644 (file)
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 static
 struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry)
index 131d21a659fbe380a006d9dfacb0ae91700468cf..6450c75a6f5b40bc28e9fe5f98cb98960cec1d10 100644 (file)
@@ -3,6 +3,7 @@
 #include "debug.h"
 #include <api/fs/fs.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
 #include <sys/utsname.h>
 #include <dirent.h>
 #include <inttypes.h>
index b8dfbe1d96704ee277de0cd0e3825fcec08bbdbe..bd883f25b76eeba2f689428b5888b8bdce72ce8a 100644 (file)
@@ -7,9 +7,6 @@
 #define _DEFAULT_SOURCE 1
 #define HAS_BOOL
 
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <stdbool.h>
 #include <stddef.h>