diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-18 09:57:25 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-19 12:01:52 -0400 |
commit | 8ec20b176c4be72d067fa18e33a4f156d1da9bc8 (patch) | |
tree | be742e7a9d1e73f5452798d86b8cb14a3a01468d | |
parent | a43783aeec5fac8ef372ff8c0a5bbb3056fc0604 (diff) |
perf str{filter,list}: Disentangle headers
There are places where we just need a forward declaration, and others
were we need to include strlist.h and/or strfilter.h, reducing the
impact of changes in headers on the build time, do it.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-zab42gbiki88y9k0csorxekb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-report.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-timechart.c | 1 | ||||
-rw-r--r-- | tools/perf/util/bpf-loader.c | 1 | ||||
-rw-r--r-- | tools/perf/util/build-id.c | 1 | ||||
-rw-r--r-- | tools/perf/util/build-id.h | 4 | ||||
-rw-r--r-- | tools/perf/util/evsel_fprintf.c | 1 | ||||
-rw-r--r-- | tools/perf/util/jitdump.c | 1 | ||||
-rw-r--r-- | tools/perf/util/map.c | 1 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-event.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-event.h | 7 | ||||
-rw-r--r-- | tools/perf/util/probe-file.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-file.h | 6 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.c | 1 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 1 | ||||
-rw-r--r-- | tools/perf/util/sort.h | 1 | ||||
-rw-r--r-- | tools/perf/util/util.h | 3 |
17 files changed, 22 insertions, 11 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 2941d8df4d40..f50738e0006e 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/rbtree.h> | 16 | #include <linux/rbtree.h> |
17 | #include "util/symbol.h" | 17 | #include "util/symbol.h" |
18 | #include "util/callchain.h" | 18 | #include "util/callchain.h" |
19 | #include "util/strlist.h" | ||
20 | #include "util/values.h" | 19 | #include "util/values.h" |
21 | 20 | ||
22 | #include "perf.h" | 21 | #include "perf.h" |
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index e2576c8f6d4e..38e2c437b7b3 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/time64.h> | 30 | #include <linux/time64.h> |
31 | #include "util/symbol.h" | 31 | #include "util/symbol.h" |
32 | #include "util/callchain.h" | 32 | #include "util/callchain.h" |
33 | #include "util/strlist.h" | ||
34 | 33 | ||
35 | #include "perf.h" | 34 | #include "perf.h" |
36 | #include "util/header.h" | 35 | #include "util/header.h" |
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index bf21c1ca9771..4bd2d1d882af 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "probe-event.h" | 19 | #include "probe-event.h" |
20 | #include "probe-finder.h" // for MAX_PROBES | 20 | #include "probe-finder.h" // for MAX_PROBES |
21 | #include "parse-events.h" | 21 | #include "parse-events.h" |
22 | #include "strfilter.h" | ||
22 | #include "llvm-utils.h" | 23 | #include "llvm-utils.h" |
23 | #include "c++/clang-c.h" | 24 | #include "c++/clang-c.h" |
24 | 25 | ||
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 8d8ef1d31b1e..f9ccd053cdf6 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "header.h" | 19 | #include "header.h" |
20 | #include "vdso.h" | 20 | #include "vdso.h" |
21 | #include "probe-file.h" | 21 | #include "probe-file.h" |
22 | #include "strlist.h" | ||
22 | 23 | ||
23 | #include "sane_ctype.h" | 24 | #include "sane_ctype.h" |
24 | 25 | ||
diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index d27990610f9f..a96081121179 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1) | 5 | #define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1) |
6 | 6 | ||
7 | #include "tool.h" | 7 | #include "tool.h" |
8 | #include "strlist.h" | ||
9 | #include <linux/types.h> | 8 | #include <linux/types.h> |
10 | 9 | ||
11 | extern struct perf_tool build_id__mark_dso_hit_ops; | 10 | extern struct perf_tool build_id__mark_dso_hit_ops; |
@@ -34,6 +33,9 @@ char *build_id_cache__origname(const char *sbuild_id); | |||
34 | char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size); | 33 | char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size); |
35 | char *build_id_cache__cachedir(const char *sbuild_id, const char *name, | 34 | char *build_id_cache__cachedir(const char *sbuild_id, const char *name, |
36 | bool is_kallsyms, bool is_vdso); | 35 | bool is_kallsyms, bool is_vdso); |
36 | |||
37 | struct strlist; | ||
38 | |||
37 | struct strlist *build_id_cache__list_all(bool validonly); | 39 | struct strlist *build_id_cache__list_all(bool validonly); |
38 | char *build_id_cache__complement(const char *incomplete_sbuild_id); | 40 | char *build_id_cache__complement(const char *incomplete_sbuild_id); |
39 | int build_id_cache__list_build_ids(const char *pathname, | 41 | int build_id_cache__list_build_ids(const char *pathname, |
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index 8000f62d5d53..e415aee6a245 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "evsel.h" | 5 | #include "evsel.h" |
6 | #include "callchain.h" | 6 | #include "callchain.h" |
7 | #include "map.h" | 7 | #include "map.h" |
8 | #include "strlist.h" | ||
8 | #include "symbol.h" | 9 | #include "symbol.h" |
9 | 10 | ||
10 | static int comma_fprintf(FILE *fp, bool *first, const char *fmt, ...) | 11 | static int comma_fprintf(FILE *fp, bool *first, const char *fmt, ...) |
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 388078d84eed..9084930e1757 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include "debug.h" | 17 | #include "debug.h" |
18 | #include "evlist.h" | 18 | #include "evlist.h" |
19 | #include "symbol.h" | 19 | #include "symbol.h" |
20 | #include "strlist.h" | ||
21 | #include <elf.h> | 20 | #include <elf.h> |
22 | 21 | ||
23 | #include "tsc.h" | 22 | #include "tsc.h" |
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 9059d20c3b8a..ebfa5d92358a 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #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 */ |
10 | #include "map.h" | 10 | #include "map.h" |
11 | #include "thread.h" | 11 | #include "thread.h" |
12 | #include "strlist.h" | ||
13 | #include "vdso.h" | 12 | #include "vdso.h" |
14 | #include "build-id.h" | 13 | #include "build-id.h" |
15 | #include "util.h" | 14 | #include "util.h" |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index d4877c8438e5..580f0e17ad38 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include "parse-events.h" | 9 | #include "parse-events.h" |
10 | #include <subcmd/exec-cmd.h> | 10 | #include <subcmd/exec-cmd.h> |
11 | #include "string2.h" | 11 | #include "string2.h" |
12 | #include "strlist.h" | ||
12 | #include "symbol.h" | 13 | #include "symbol.h" |
13 | #include "cache.h" | 14 | #include "cache.h" |
14 | #include "header.h" | 15 | #include "header.h" |
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 8f1374071cfc..84e7e698411e 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "util.h" | 36 | #include "util.h" |
37 | #include "event.h" | 37 | #include "event.h" |
38 | #include "strlist.h" | 38 | #include "strlist.h" |
39 | #include "strfilter.h" | ||
39 | #include "debug.h" | 40 | #include "debug.h" |
40 | #include "cache.h" | 41 | #include "cache.h" |
41 | #include "color.h" | 42 | #include "color.h" |
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index 5d4e94061402..373842656fb6 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include "intlist.h" | 5 | #include "intlist.h" |
6 | #include "strlist.h" | ||
7 | #include "strfilter.h" | ||
8 | 6 | ||
9 | /* Probe related configurations */ | 7 | /* Probe related configurations */ |
10 | struct probe_conf { | 8 | struct probe_conf { |
@@ -107,6 +105,8 @@ struct line_range { | |||
107 | struct intlist *line_list; /* Visible lines */ | 105 | struct intlist *line_list; /* Visible lines */ |
108 | }; | 106 | }; |
109 | 107 | ||
108 | struct strlist; | ||
109 | |||
110 | /* List of variables */ | 110 | /* List of variables */ |
111 | struct variable_list { | 111 | struct variable_list { |
112 | struct probe_trace_point point; /* Actual probepoint */ | 112 | struct probe_trace_point point; /* Actual probepoint */ |
@@ -153,6 +153,9 @@ int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs); | |||
153 | int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs); | 153 | int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs); |
154 | int show_probe_trace_events(struct perf_probe_event *pevs, int npevs); | 154 | int show_probe_trace_events(struct perf_probe_event *pevs, int npevs); |
155 | void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs); | 155 | void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs); |
156 | |||
157 | struct strfilter; | ||
158 | |||
156 | int del_perf_probe_events(struct strfilter *filter); | 159 | int del_perf_probe_events(struct strfilter *filter); |
157 | 160 | ||
158 | int show_perf_probe_event(const char *group, const char *event, | 161 | int show_perf_probe_event(const char *group, const char *event, |
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c index 1ccaefdc05c4..685653f2bc32 100644 --- a/tools/perf/util/probe-file.c +++ b/tools/perf/util/probe-file.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "util.h" | 19 | #include "util.h" |
20 | #include "event.h" | 20 | #include "event.h" |
21 | #include "strlist.h" | 21 | #include "strlist.h" |
22 | #include "strfilter.h" | ||
22 | #include "debug.h" | 23 | #include "debug.h" |
23 | #include "cache.h" | 24 | #include "cache.h" |
24 | #include "color.h" | 25 | #include "color.h" |
diff --git a/tools/perf/util/probe-file.h b/tools/perf/util/probe-file.h index dbf95a00864a..5ecc9d3925db 100644 --- a/tools/perf/util/probe-file.h +++ b/tools/perf/util/probe-file.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef __PROBE_FILE_H | 1 | #ifndef __PROBE_FILE_H |
2 | #define __PROBE_FILE_H | 2 | #define __PROBE_FILE_H |
3 | 3 | ||
4 | #include "strlist.h" | ||
5 | #include "strfilter.h" | ||
6 | #include "probe-event.h" | 4 | #include "probe-event.h" |
7 | 5 | ||
6 | struct strlist; | ||
7 | struct strfilter; | ||
8 | |||
8 | /* Cache of probe definitions */ | 9 | /* Cache of probe definitions */ |
9 | struct probe_cache_entry { | 10 | struct probe_cache_entry { |
10 | struct list_head node; | 11 | struct list_head node; |
@@ -41,6 +42,7 @@ int probe_file__open_both(int *kfd, int *ufd, int flag); | |||
41 | struct strlist *probe_file__get_namelist(int fd); | 42 | struct strlist *probe_file__get_namelist(int fd); |
42 | struct strlist *probe_file__get_rawlist(int fd); | 43 | struct strlist *probe_file__get_rawlist(int fd); |
43 | int probe_file__add_event(int fd, struct probe_trace_event *tev); | 44 | int probe_file__add_event(int fd, struct probe_trace_event *tev); |
45 | |||
44 | int probe_file__del_events(int fd, struct strfilter *filter); | 46 | int probe_file__del_events(int fd, struct strfilter *filter); |
45 | int probe_file__get_events(int fd, struct strfilter *filter, | 47 | int probe_file__get_events(int fd, struct strfilter *filter, |
46 | struct strlist *plist); | 48 | struct strlist *plist); |
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 3f3cd11d3b7c..a5731de0e5eb 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "debug.h" | 38 | #include "debug.h" |
39 | #include "intlist.h" | 39 | #include "intlist.h" |
40 | #include "util.h" | 40 | #include "util.h" |
41 | #include "strlist.h" | ||
41 | #include "symbol.h" | 42 | #include "symbol.h" |
42 | #include "probe-finder.h" | 43 | #include "probe-finder.h" |
43 | #include "probe-file.h" | 44 | #include "probe-file.h" |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 9aa058e167e8..4df228ab4db1 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "symbol.h" | 7 | #include "symbol.h" |
8 | #include "evsel.h" | 8 | #include "evsel.h" |
9 | #include "evlist.h" | 9 | #include "evlist.h" |
10 | #include "strlist.h" | ||
10 | #include <traceevent/event-parse.h> | 11 | #include <traceevent/event-parse.h> |
11 | #include "mem-events.h" | 12 | #include "mem-events.h" |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 535903297cee..421232a27e7b 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #include "symbol.h" | 11 | #include "symbol.h" |
12 | #include "string.h" | 12 | #include "string.h" |
13 | #include "callchain.h" | 13 | #include "callchain.h" |
14 | #include "strlist.h" | ||
15 | #include "values.h" | 14 | #include "values.h" |
16 | 15 | ||
17 | #include "../perf.h" | 16 | #include "../perf.h" |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 6fd9963be1c8..397676c25232 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <termios.h> | 40 | #include <termios.h> |
41 | #include <linux/bitops.h> | 41 | #include <linux/bitops.h> |
42 | #include <termios.h> | 42 | #include <termios.h> |
43 | #include "strlist.h" | ||
44 | 43 | ||
45 | extern char buildid_dir[]; | 44 | extern char buildid_dir[]; |
46 | 45 | ||
@@ -89,6 +88,8 @@ static inline void *zalloc(size_t size) | |||
89 | 88 | ||
90 | #define zfree(ptr) ({ free(*ptr); *ptr = NULL; }) | 89 | #define zfree(ptr) ({ free(*ptr); *ptr = NULL; }) |
91 | 90 | ||
91 | struct strlist; | ||
92 | |||
92 | int mkdir_p(char *path, mode_t mode); | 93 | int mkdir_p(char *path, mode_t mode); |
93 | int rm_rf(const char *path); | 94 | int rm_rf(const char *path); |
94 | struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *)); | 95 | struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *)); |