summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-04-17 15:30:49 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-04-19 12:01:50 -0400
commit632a5cabea21eb079b788d2bb4a9318bd6fff5e1 (patch)
tree117f8c9dd2a18482217d8b2dd236964d36a222b0
parentfea013928cdcf81fbe0bfbf9e2eed1c7da2d62c2 (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.c1
-rw-r--r--tools/perf/ui/stdio/hist.c1
-rw-r--r--tools/perf/util/hist.c1
-rw-r--r--tools/perf/util/map.c1
-rw-r--r--tools/perf/util/sort.h1
-rw-r--r--tools/perf/util/srcline.c1
-rw-r--r--tools/perf/util/srcline.h34
-rw-r--r--tools/perf/util/util.h27
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
9static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) 10static 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
21static void __maps__insert(struct maps *maps, struct map *map); 22static 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
26extern regex_t parent_regex; 27extern 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
7struct dso;
8struct symbol;
9
10extern bool srcline_full_filename;
11char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
12 bool show_sym, bool show_addr);
13char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
14 bool show_sym, bool show_addr, bool unwind_inlines);
15void free_srcline(char *srcline);
16
17#define SRCLINE_UNKNOWN ((char *) "??:0")
18
19struct inline_list {
20 char *filename;
21 char *funcname;
22 unsigned int line_nr;
23 struct list_head list;
24};
25
26struct inline_node {
27 u64 addr;
28 struct list_head val;
29};
30
31struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr);
32void 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
145unsigned long parse_tag_value(const char *str, struct parse_tag *tags); 145unsigned long parse_tag_value(const char *str, struct parse_tag *tags);
146 146
147#define SRCLINE_UNKNOWN ((char *) "??:0")
148
149static inline int path__join(char *bf, size_t size, 147static 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
164struct dso;
165struct symbol;
166
167extern bool srcline_full_filename;
168char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
169 bool show_sym, bool show_addr);
170char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
171 bool show_sym, bool show_addr, bool unwind_inlines);
172void free_srcline(char *srcline);
173
174int perf_event_paranoid(void); 162int perf_event_paranoid(void);
175 163
176void mem_bswap_64(void *src, int byte_size); 164void 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
222int unit_number__scnprintf(char *buf, size_t size, u64 n); 210int unit_number__scnprintf(char *buf, size_t size, u64 n);
223 211
224struct inline_list {
225 char *filename;
226 char *funcname;
227 unsigned int line_nr;
228 struct list_head list;
229};
230
231struct inline_node {
232 u64 addr;
233 struct list_head val;
234};
235
236struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr);
237void inline_node__delete(struct inline_node *node);
238
239#endif /* GIT_COMPAT_UTIL_H */ 212#endif /* GIT_COMPAT_UTIL_H */