forked from Minki/linux
11ea2515f3
The inline_node structs are maintained by the new dso->inlines tree. This in turn keeps ownership of the fake symbols and srcline string representing an inline frame. This tree is sorted by address to allow quick lookups. All other entries of the symbol beside the function name are unused for inline frames. The advantage of this approach is that all existing users of the callchain API can now transparently display inlined frames without having to patch their code. Signed-off-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Yao Jin <yao.jin@linux.intel.com> Link: http://lkml.kernel.org/r/20171009203310.17362-6-milian.wolff@kdab.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
#ifndef PERF_SRCLINE_H
|
|
#define PERF_SRCLINE_H
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/rbtree.h>
|
|
#include <linux/types.h>
|
|
|
|
struct dso;
|
|
struct symbol;
|
|
|
|
extern bool srcline_full_filename;
|
|
char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
|
|
bool show_sym, bool show_addr);
|
|
char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
|
|
bool show_sym, bool show_addr, bool unwind_inlines);
|
|
void free_srcline(char *srcline);
|
|
|
|
#define SRCLINE_UNKNOWN ((char *) "??:0")
|
|
|
|
struct inline_list {
|
|
struct symbol *symbol;
|
|
char *srcline;
|
|
struct list_head list;
|
|
};
|
|
|
|
struct inline_node {
|
|
u64 addr;
|
|
struct list_head val;
|
|
struct rb_node rb_node;
|
|
};
|
|
|
|
/* parse inlined frames for the given address */
|
|
struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
|
|
struct symbol *sym);
|
|
/* free resources associated to the inline node list */
|
|
void inline_node__delete(struct inline_node *node);
|
|
|
|
/* insert the inline node list into the DSO, which will take ownership */
|
|
void inlines__tree_insert(struct rb_root *tree, struct inline_node *inlines);
|
|
/* find previously inserted inline node list */
|
|
struct inline_node *inlines__tree_find(struct rb_root *tree, u64 addr);
|
|
/* delete all nodes within the tree of inline_node s */
|
|
void inlines__tree_delete(struct rb_root *tree);
|
|
|
|
#endif /* PERF_SRCLINE_H */
|