diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-17 15:30:49 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-19 12:01:50 -0400 |
commit | 632a5cabea21eb079b788d2bb4a9318bd6fff5e1 (patch) | |
tree | 117f8c9dd2a18482217d8b2dd236964d36a222b0 | |
parent | fea013928cdcf81fbe0bfbf9e2eed1c7da2d62c2 (diff) |
perf tools: Move srcline definitions to separate header
Out of util.h into a new file, srcline.h
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-ludnlm4djqcdjziekzr4s3u9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 1 | ||||
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 1 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 1 | ||||
-rw-r--r-- | tools/perf/util/map.c | 1 | ||||
-rw-r--r-- | tools/perf/util/sort.h | 1 | ||||
-rw-r--r-- | tools/perf/util/srcline.c | 1 | ||||
-rw-r--r-- | tools/perf/util/srcline.h | 34 | ||||
-rw-r--r-- | tools/perf/util/util.h | 27 |
8 files changed, 40 insertions, 27 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 56f5c038689e..ac7f6a3e4a86 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "../ui.h" | 19 | #include "../ui.h" |
20 | #include "map.h" | 20 | #include "map.h" |
21 | #include "annotate.h" | 21 | #include "annotate.h" |
22 | #include "srcline.h" | ||
22 | 23 | ||
23 | #include "sane_ctype.h" | 24 | #include "sane_ctype.h" |
24 | 25 | ||
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 297a79c69b71..66aa4eb369f1 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include "../../util/hist.h" | 4 | #include "../../util/hist.h" |
5 | #include "../../util/sort.h" | 5 | #include "../../util/sort.h" |
6 | #include "../../util/evsel.h" | 6 | #include "../../util/evsel.h" |
7 | #include "../../util/srcline.h" | ||
7 | #include "../../util/sane_ctype.h" | 8 | #include "../../util/sane_ctype.h" |
8 | 9 | ||
9 | static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) | 10 | static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 61bf304206fd..af3bd5d31d99 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "evlist.h" | 8 | #include "evlist.h" |
9 | #include "evsel.h" | 9 | #include "evsel.h" |
10 | #include "annotate.h" | 10 | #include "annotate.h" |
11 | #include "srcline.h" | ||
11 | #include "ui/progress.h" | 12 | #include "ui/progress.h" |
12 | #include <math.h> | 13 | #include <math.h> |
13 | 14 | ||
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index c1870ac365a3..9059d20c3b8a 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "debug.h" | 16 | #include "debug.h" |
17 | #include "machine.h" | 17 | #include "machine.h" |
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include "srcline.h" | ||
19 | #include "unwind.h" | 20 | #include "unwind.h" |
20 | 21 | ||
21 | static void __maps__insert(struct maps *maps, struct map *map); | 22 | static void __maps__insert(struct maps *maps, struct map *map); |
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index e35fb186d048..535903297cee 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <subcmd/parse-options.h> | 21 | #include <subcmd/parse-options.h> |
22 | #include "parse-events.h" | 22 | #include "parse-events.h" |
23 | #include "hist.h" | 23 | #include "hist.h" |
24 | #include "srcline.h" | ||
24 | #include "thread.h" | 25 | #include "thread.h" |
25 | 26 | ||
26 | extern regex_t parent_regex; | 27 | extern regex_t parent_regex; |
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index ef192802edc9..df051a52393c 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include "util/util.h" | 9 | #include "util/util.h" |
10 | #include "util/debug.h" | 10 | #include "util/debug.h" |
11 | #include "util/callchain.h" | 11 | #include "util/callchain.h" |
12 | #include "srcline.h" | ||
12 | 13 | ||
13 | #include "symbol.h" | 14 | #include "symbol.h" |
14 | 15 | ||
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h new file mode 100644 index 000000000000..7b52ba88676e --- /dev/null +++ b/tools/perf/util/srcline.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef PERF_SRCLINE_H | ||
2 | #define PERF_SRCLINE_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | #include <linux/types.h> | ||
6 | |||
7 | struct dso; | ||
8 | struct symbol; | ||
9 | |||
10 | extern bool srcline_full_filename; | ||
11 | char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, | ||
12 | bool show_sym, bool show_addr); | ||
13 | char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, | ||
14 | bool show_sym, bool show_addr, bool unwind_inlines); | ||
15 | void free_srcline(char *srcline); | ||
16 | |||
17 | #define SRCLINE_UNKNOWN ((char *) "??:0") | ||
18 | |||
19 | struct inline_list { | ||
20 | char *filename; | ||
21 | char *funcname; | ||
22 | unsigned int line_nr; | ||
23 | struct list_head list; | ||
24 | }; | ||
25 | |||
26 | struct inline_node { | ||
27 | u64 addr; | ||
28 | struct list_head val; | ||
29 | }; | ||
30 | |||
31 | struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr); | ||
32 | void inline_node__delete(struct inline_node *node); | ||
33 | |||
34 | #endif /* PERF_SRCLINE_H */ | ||
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 4d9069ab569a..46cfdccc32bc 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -144,8 +144,6 @@ struct parse_tag { | |||
144 | 144 | ||
145 | unsigned long parse_tag_value(const char *str, struct parse_tag *tags); | 145 | unsigned long parse_tag_value(const char *str, struct parse_tag *tags); |
146 | 146 | ||
147 | #define SRCLINE_UNKNOWN ((char *) "??:0") | ||
148 | |||
149 | static inline int path__join(char *bf, size_t size, | 147 | static inline int path__join(char *bf, size_t size, |
150 | const char *path1, const char *path2) | 148 | const char *path1, const char *path2) |
151 | { | 149 | { |
@@ -161,16 +159,6 @@ static inline int path__join3(char *bf, size_t size, | |||
161 | path2, path2[0] ? "/" : "", path3); | 159 | path2, path2[0] ? "/" : "", path3); |
162 | } | 160 | } |
163 | 161 | ||
164 | struct dso; | ||
165 | struct symbol; | ||
166 | |||
167 | extern bool srcline_full_filename; | ||
168 | char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, | ||
169 | bool show_sym, bool show_addr); | ||
170 | char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, | ||
171 | bool show_sym, bool show_addr, bool unwind_inlines); | ||
172 | void free_srcline(char *srcline); | ||
173 | |||
174 | int perf_event_paranoid(void); | 162 | int perf_event_paranoid(void); |
175 | 163 | ||
176 | void mem_bswap_64(void *src, int byte_size); | 164 | void mem_bswap_64(void *src, int byte_size); |
@@ -221,19 +209,4 @@ int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz); | |||
221 | 209 | ||
222 | int unit_number__scnprintf(char *buf, size_t size, u64 n); | 210 | int unit_number__scnprintf(char *buf, size_t size, u64 n); |
223 | 211 | ||
224 | struct inline_list { | ||
225 | char *filename; | ||
226 | char *funcname; | ||
227 | unsigned int line_nr; | ||
228 | struct list_head list; | ||
229 | }; | ||
230 | |||
231 | struct inline_node { | ||
232 | u64 addr; | ||
233 | struct list_head val; | ||
234 | }; | ||
235 | |||
236 | struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr); | ||
237 | void inline_node__delete(struct inline_node *node); | ||
238 | |||
239 | #endif /* GIT_COMPAT_UTIL_H */ | 212 | #endif /* GIT_COMPAT_UTIL_H */ |