]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
632a5cab ACM |
2 | #ifndef PERF_SRCLINE_H |
3 | #define PERF_SRCLINE_H | |
4 | ||
5 | #include <linux/list.h> | |
11ea2515 | 6 | #include <linux/rbtree.h> |
632a5cab ACM |
7 | #include <linux/types.h> |
8 | ||
9 | struct dso; | |
10 | struct symbol; | |
11 | ||
701677b9 | 12 | extern int addr2line_timeout_ms; |
632a5cab ACM |
13 | extern bool srcline_full_filename; |
14 | char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, | |
935f5a9d | 15 | bool show_sym, bool show_addr, u64 ip); |
632a5cab | 16 | char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, |
935f5a9d JY |
17 | bool show_sym, bool show_addr, bool unwind_inlines, |
18 | u64 ip); | |
625db36e | 19 | void zfree_srcline(char **srcline); |
dd2e18e9 | 20 | char *get_srcline_split(struct dso *dso, u64 addr, unsigned *line); |
632a5cab | 21 | |
21ac9d54 | 22 | /* insert the srcline into the DSO, which will take ownership */ |
55ecd631 | 23 | void srcline__tree_insert(struct rb_root_cached *tree, u64 addr, char *srcline); |
21ac9d54 | 24 | /* find previously inserted srcline */ |
55ecd631 | 25 | char *srcline__tree_find(struct rb_root_cached *tree, u64 addr); |
21ac9d54 | 26 | /* delete all srclines within the tree */ |
55ecd631 | 27 | void srcline__tree_delete(struct rb_root_cached *tree); |
21ac9d54 | 28 | |
922db21d ACM |
29 | extern char *srcline__unknown; |
30 | #define SRCLINE_UNKNOWN srcline__unknown | |
632a5cab ACM |
31 | |
32 | struct inline_list { | |
fea0cf84 | 33 | struct symbol *symbol; |
2be8832f | 34 | char *srcline; |
632a5cab ACM |
35 | struct list_head list; |
36 | }; | |
37 | ||
38 | struct inline_node { | |
39 | u64 addr; | |
40 | struct list_head val; | |
11ea2515 | 41 | struct rb_node rb_node; |
632a5cab ACM |
42 | }; |
43 | ||
fea0cf84 MW |
44 | /* parse inlined frames for the given address */ |
45 | struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr, | |
46 | struct symbol *sym); | |
47 | /* free resources associated to the inline node list */ | |
632a5cab ACM |
48 | void inline_node__delete(struct inline_node *node); |
49 | ||
11ea2515 | 50 | /* insert the inline node list into the DSO, which will take ownership */ |
55ecd631 DB |
51 | void inlines__tree_insert(struct rb_root_cached *tree, |
52 | struct inline_node *inlines); | |
11ea2515 | 53 | /* find previously inserted inline node list */ |
55ecd631 | 54 | struct inline_node *inlines__tree_find(struct rb_root_cached *tree, u64 addr); |
11ea2515 | 55 | /* delete all nodes within the tree of inline_node s */ |
55ecd631 | 56 | void inlines__tree_delete(struct rb_root_cached *tree); |
11ea2515 | 57 | |
632a5cab | 58 | #endif /* PERF_SRCLINE_H */ |