diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2017-10-09 22:32:59 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-10-24 09:59:55 -0300 |
commit | 11ea2515f32e783b9a7984c148e742c377383915 (patch) | |
tree | 20cc19b2a0fb98e4a6e2d8025a6d5cfdccfa4d55 /tools/perf/util/srcline.h | |
parent | 2be8832f3c51cf9e36a3e80ff57f4137505c2ba4 (diff) | |
download | linux-11ea2515f32e783b9a7984c148e742c377383915.tar.gz linux-11ea2515f32e783b9a7984c148e742c377383915.tar.bz2 linux-11ea2515f32e783b9a7984c148e742c377383915.zip |
perf callchain: Create real callchain entries for inlined frames
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>
Diffstat (limited to 'tools/perf/util/srcline.h')
-rw-r--r-- | tools/perf/util/srcline.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h index 0201ed2c0b9c..ebe38cd22294 100644 --- a/tools/perf/util/srcline.h +++ b/tools/perf/util/srcline.h @@ -2,6 +2,7 @@ #define PERF_SRCLINE_H #include <linux/list.h> +#include <linux/rbtree.h> #include <linux/types.h> struct dso; @@ -25,6 +26,7 @@ struct inline_list { struct inline_node { u64 addr; struct list_head val; + struct rb_node rb_node; }; /* parse inlined frames for the given address */ @@ -33,4 +35,11 @@ struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr, /* 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 */ |