diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-19 19:57:47 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-24 12:43:33 -0400 |
commit | 7a8ef4c4b5fd5c578da4dadbcb1c5da650426c74 (patch) | |
tree | 84e400a1a819a9ff044fe4ca8eb196ab35cb490b /tools/perf | |
parent | a3b70b3bb34296a63b43614f13991111eccbb44a (diff) |
perf tools: Remove string.h, unistd.h and sys/stat.h from util.h
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>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/arch/arm/util/cs-etm.c | 1 | ||||
-rw-r--r-- | tools/perf/arch/arm64/util/dwarf-regs.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-help.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-mem.c | 3 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 3 | ||||
-rw-r--r-- | tools/perf/builtin-script.c | 3 | ||||
-rw-r--r-- | tools/perf/builtin-stat.c | 3 | ||||
-rw-r--r-- | tools/perf/builtin-version.c | 3 | ||||
-rw-r--r-- | tools/perf/perf.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/attr.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/bpf.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/parse-events.c | 3 | ||||
-rw-r--r-- | tools/perf/util/build-id.c | 2 | ||||
-rw-r--r-- | tools/perf/util/color.h | 2 | ||||
-rw-r--r-- | tools/perf/util/config.c | 3 | ||||
-rw-r--r-- | tools/perf/util/dso.c | 3 | ||||
-rw-r--r-- | tools/perf/util/event.c | 3 | ||||
-rw-r--r-- | tools/perf/util/header.c | 3 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 3 | ||||
-rw-r--r-- | tools/perf/util/pmu.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-file.c | 3 | ||||
-rw-r--r-- | tools/perf/util/strlist.c | 1 | ||||
-rw-r--r-- | tools/perf/util/util.c | 1 | ||||
-rw-r--r-- | tools/perf/util/util.h | 3 |
24 files changed, 56 insertions, 4 deletions
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index dfea6b635525..29361d9b635a 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "../../util/cs-etm.h" | 33 | #include "../../util/cs-etm.h" |
34 | 34 | ||
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | #include <sys/stat.h> | ||
36 | 37 | ||
37 | #define ENABLE_SINK_MAX 128 | 38 | #define ENABLE_SINK_MAX 128 |
38 | #define CS_BUS_DEVICE_PATH "/bus/coresight/devices/" | 39 | #define CS_BUS_DEVICE_PATH "/bus/coresight/devices/" |
diff --git a/tools/perf/arch/arm64/util/dwarf-regs.c b/tools/perf/arch/arm64/util/dwarf-regs.c index f268720ff021..cd764a9fd098 100644 --- a/tools/perf/arch/arm64/util/dwarf-regs.c +++ b/tools/perf/arch/arm64/util/dwarf-regs.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <errno.h> | 11 | #include <errno.h> |
12 | #include <stddef.h> | 12 | #include <stddef.h> |
13 | #include <string.h> | ||
13 | #include <dwarf-regs.h> | 14 | #include <dwarf-regs.h> |
14 | #include <linux/ptrace.h> /* for struct user_pt_regs */ | 15 | #include <linux/ptrace.h> /* for struct user_pt_regs */ |
15 | #include <linux/stringify.h> | 16 | #include <linux/stringify.h> |
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 7bde2f59dac2..492f8e14ab09 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
@@ -14,6 +14,10 @@ | |||
14 | #include "util/debug.h" | 14 | #include "util/debug.h" |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <errno.h> | 16 | #include <errno.h> |
17 | #include <stdio.h> | ||
18 | #include <sys/types.h> | ||
19 | #include <sys/stat.h> | ||
20 | #include <unistd.h> | ||
17 | 21 | ||
18 | static struct man_viewer_list { | 22 | static struct man_viewer_list { |
19 | struct man_viewer_list *next; | 23 | struct man_viewer_list *next; |
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 1ebc67390898..2e5be1d63af6 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c | |||
@@ -1,4 +1,7 @@ | |||
1 | #include <inttypes.h> | 1 | #include <inttypes.h> |
2 | #include <sys/types.h> | ||
3 | #include <sys/stat.h> | ||
4 | #include <unistd.h> | ||
2 | #include "builtin.h" | 5 | #include "builtin.h" |
3 | #include "perf.h" | 6 | #include "perf.h" |
4 | 7 | ||
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3f89e0eaf0d4..22478ff2b706 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -46,6 +46,9 @@ | |||
46 | #include <signal.h> | 46 | #include <signal.h> |
47 | #include <linux/bitmap.h> | 47 | #include <linux/bitmap.h> |
48 | #include <linux/stringify.h> | 48 | #include <linux/stringify.h> |
49 | #include <sys/types.h> | ||
50 | #include <sys/stat.h> | ||
51 | #include <unistd.h> | ||
49 | 52 | ||
50 | struct report { | 53 | struct report { |
51 | struct perf_tool tool; | 54 | struct perf_tool tool; |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index b093a3c21e40..d05aec491cff 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -37,6 +37,9 @@ | |||
37 | #include <inttypes.h> | 37 | #include <inttypes.h> |
38 | #include <signal.h> | 38 | #include <signal.h> |
39 | #include <sys/param.h> | 39 | #include <sys/param.h> |
40 | #include <sys/types.h> | ||
41 | #include <sys/stat.h> | ||
42 | #include <unistd.h> | ||
40 | 43 | ||
41 | #include "sane_ctype.h" | 44 | #include "sane_ctype.h" |
42 | 45 | ||
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e3837febb4ff..eb3cc0b9a9e4 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -76,6 +76,9 @@ | |||
76 | #include <inttypes.h> | 76 | #include <inttypes.h> |
77 | #include <locale.h> | 77 | #include <locale.h> |
78 | #include <math.h> | 78 | #include <math.h> |
79 | #include <sys/types.h> | ||
80 | #include <sys/stat.h> | ||
81 | #include <unistd.h> | ||
79 | 82 | ||
80 | #include "sane_ctype.h" | 83 | #include "sane_ctype.h" |
81 | 84 | ||
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c index b9a095b1db99..d25149456a2f 100644 --- a/tools/perf/builtin-version.c +++ b/tools/perf/builtin-version.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "util/util.h" | ||
2 | #include "builtin.h" | 1 | #include "builtin.h" |
3 | #include "perf.h" | 2 | #include "perf.h" |
3 | #include <linux/compiler.h> | ||
4 | #include <stdio.h> | ||
4 | 5 | ||
5 | int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused) | 6 | int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused) |
6 | { | 7 | { |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 0b2cad0fb3f9..4cc6960f6226 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -24,6 +24,9 @@ | |||
24 | #include <signal.h> | 24 | #include <signal.h> |
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <time.h> | 26 | #include <time.h> |
27 | #include <sys/types.h> | ||
28 | #include <sys/stat.h> | ||
29 | #include <unistd.h> | ||
27 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
28 | 31 | ||
29 | const char perf_usage_string[] = | 32 | const char perf_usage_string[] = |
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c index c19e0da54337..0dd77494bb58 100644 --- a/tools/perf/tests/attr.c +++ b/tools/perf/tests/attr.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <sys/param.h> | 27 | #include <sys/param.h> |
28 | #include <sys/types.h> | ||
29 | #include <sys/stat.h> | ||
30 | #include <unistd.h> | ||
28 | #include "../perf.h" | 31 | #include "../perf.h" |
29 | #include "util.h" | 32 | #include "util.h" |
30 | #include <subcmd/exec-cmd.h> | 33 | #include <subcmd/exec-cmd.h> |
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index b78fbd611a7c..5876da126b58 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c | |||
@@ -1,6 +1,8 @@ | |||
1 | #include <errno.h> | 1 | #include <errno.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <sys/epoll.h> | 3 | #include <sys/epoll.h> |
4 | #include <sys/types.h> | ||
5 | #include <sys/stat.h> | ||
4 | #include <util/util.h> | 6 | #include <util/util.h> |
5 | #include <util/bpf-loader.h> | 7 | #include <util/bpf-loader.h> |
6 | #include <util/evlist.h> | 8 | #include <util/evlist.h> |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 981d2bf9914f..7fad885491c5 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -7,6 +7,9 @@ | |||
7 | #include "util.h" | 7 | #include "util.h" |
8 | #include <dirent.h> | 8 | #include <dirent.h> |
9 | #include <errno.h> | 9 | #include <errno.h> |
10 | #include <sys/types.h> | ||
11 | #include <sys/stat.h> | ||
12 | #include <unistd.h> | ||
10 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
11 | #include <linux/hw_breakpoint.h> | 14 | #include <linux/hw_breakpoint.h> |
12 | #include <api/fs/fs.h> | 15 | #include <api/fs/fs.h> |
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 923ea290bb6e..687b5add4bde 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <dirent.h> | 10 | #include <dirent.h> |
11 | #include <errno.h> | 11 | #include <errno.h> |
12 | #include <stdio.h> | 12 | #include <stdio.h> |
13 | #include <sys/stat.h> | ||
14 | #include <sys/types.h> | ||
13 | #include "build-id.h" | 15 | #include "build-id.h" |
14 | #include "event.h" | 16 | #include "event.h" |
15 | #include "symbol.h" | 17 | #include "symbol.h" |
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h index a93997f16dec..52122bcc3170 100644 --- a/tools/perf/util/color.h +++ b/tools/perf/util/color.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __PERF_COLOR_H | 1 | #ifndef __PERF_COLOR_H |
2 | #define __PERF_COLOR_H | 2 | #define __PERF_COLOR_H |
3 | 3 | ||
4 | #include <stdio.h> | ||
5 | |||
4 | /* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */ | 6 | /* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */ |
5 | #define COLOR_MAXLEN 24 | 7 | #define COLOR_MAXLEN 24 |
6 | 8 | ||
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index 07d87d2dbee7..8d724f0fa5a8 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c | |||
@@ -16,6 +16,9 @@ | |||
16 | #include "util/hist.h" /* perf_hist_config */ | 16 | #include "util/hist.h" /* perf_hist_config */ |
17 | #include "util/llvm-utils.h" /* perf_llvm_config */ | 17 | #include "util/llvm-utils.h" /* perf_llvm_config */ |
18 | #include "config.h" | 18 | #include "config.h" |
19 | #include <sys/types.h> | ||
20 | #include <sys/stat.h> | ||
21 | #include <unistd.h> | ||
19 | 22 | ||
20 | #include "sane_ctype.h" | 23 | #include "sane_ctype.h" |
21 | 24 | ||
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 3339ab7cabc5..a96a99d2369f 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -2,6 +2,9 @@ | |||
2 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
3 | #include <sys/time.h> | 3 | #include <sys/time.h> |
4 | #include <sys/resource.h> | 4 | #include <sys/resource.h> |
5 | #include <sys/types.h> | ||
6 | #include <sys/stat.h> | ||
7 | #include <unistd.h> | ||
5 | #include <errno.h> | 8 | #include <errno.h> |
6 | #include "compress.h" | 9 | #include "compress.h" |
7 | #include "path.h" | 10 | #include "path.h" |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index cf457ef534da..2e829ac0f615 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -3,6 +3,9 @@ | |||
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <sys/types.h> | ||
7 | #include <sys/stat.h> | ||
8 | #include <unistd.h> | ||
6 | #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ | 9 | #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ |
7 | #include <api/fs/fs.h> | 10 | #include <api/fs/fs.h> |
8 | #include "event.h" | 11 | #include "event.h" |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 915bc4f39482..948b2c5efb65 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -11,7 +11,10 @@ | |||
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
14 | #include <sys/stat.h> | ||
15 | #include <sys/types.h> | ||
14 | #include <sys/utsname.h> | 16 | #include <sys/utsname.h> |
17 | #include <unistd.h> | ||
15 | 18 | ||
16 | #include "evlist.h" | 19 | #include "evlist.h" |
17 | #include "evsel.h" | 20 | #include "evsel.h" |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 988e84ce6f88..7a47f52ccfcc 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -14,6 +14,9 @@ | |||
14 | #include "thread.h" | 14 | #include "thread.h" |
15 | #include "vdso.h" | 15 | #include "vdso.h" |
16 | #include <stdbool.h> | 16 | #include <stdbool.h> |
17 | #include <sys/types.h> | ||
18 | #include <sys/stat.h> | ||
19 | #include <unistd.h> | ||
17 | #include "unwind.h" | 20 | #include "unwind.h" |
18 | #include "linux/hash.h" | 21 | #include "linux/hash.h" |
19 | #include "asm/bug.h" | 22 | #include "asm/bug.h" |
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index bca1844594d0..ac16a9db1fb5 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <sys/types.h> | 3 | #include <sys/types.h> |
4 | #include <errno.h> | 4 | #include <errno.h> |
5 | #include <sys/stat.h> | ||
5 | #include <unistd.h> | 6 | #include <unistd.h> |
6 | #include <stdio.h> | 7 | #include <stdio.h> |
7 | #include <stdbool.h> | 8 | #include <stdbool.h> |
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c index 685653f2bc32..d679389e627c 100644 --- a/tools/perf/util/probe-file.c +++ b/tools/perf/util/probe-file.c | |||
@@ -15,7 +15,10 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | #include <errno.h> | 17 | #include <errno.h> |
18 | #include <sys/stat.h> | ||
19 | #include <sys/types.h> | ||
18 | #include <sys/uio.h> | 20 | #include <sys/uio.h> |
21 | #include <unistd.h> | ||
19 | #include "util.h" | 22 | #include "util.h" |
20 | #include "event.h" | 23 | #include "event.h" |
21 | #include "strlist.h" | 24 | #include "strlist.h" |
diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c index 0d3dfcb919b4..9de5434bb49e 100644 --- a/tools/perf/util/strlist.c +++ b/tools/perf/util/strlist.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
12 | #include <string.h> | 12 | #include <string.h> |
13 | #include <unistd.h> | ||
13 | 14 | ||
14 | static | 15 | static |
15 | struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry) | 16 | struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry) |
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 131d21a659fb..6450c75a6f5b 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "debug.h" | 3 | #include "debug.h" |
4 | #include <api/fs/fs.h> | 4 | #include <api/fs/fs.h> |
5 | #include <sys/mman.h> | 5 | #include <sys/mman.h> |
6 | #include <sys/stat.h> | ||
6 | #include <sys/utsname.h> | 7 | #include <sys/utsname.h> |
7 | #include <dirent.h> | 8 | #include <dirent.h> |
8 | #include <inttypes.h> | 9 | #include <inttypes.h> |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index b8dfbe1d9670..bd883f25b76e 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -7,9 +7,6 @@ | |||
7 | #define _DEFAULT_SOURCE 1 | 7 | #define _DEFAULT_SOURCE 1 |
8 | #define HAS_BOOL | 8 | #define HAS_BOOL |
9 | 9 | ||
10 | #include <unistd.h> | ||
11 | #include <stdio.h> | ||
12 | #include <sys/stat.h> | ||
13 | #include <fcntl.h> | 10 | #include <fcntl.h> |
14 | #include <stdbool.h> | 11 | #include <stdbool.h> |
15 | #include <stddef.h> | 12 | #include <stddef.h> |