From 6a4694a433a218c729d336b348a01bfc720da095 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 27 Nov 2009 16:29:17 -0200 Subject: perf symbols: Better support for multiple symbol tables per dso MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By using an array of rb_roots in struct dso we can, from a struct map instance to get the right symbol rb_tree more easily. This way we can have just one symbol lookup method for struct map instances, map__find_symbol, instead of one per symtab type (functions, variables). Signed-off-by: Arnaldo Carvalho de Melo Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Paul Mackerras LKML-Reference: <1259346563-12568-6-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar --- tools/perf/util/symbol.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools/perf/util/symbol.h') diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 11d41952ce04..8934814d5a64 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -65,8 +65,9 @@ static inline void *symbol__priv(struct symbol *self) struct dso { struct list_head node; - struct rb_root functions; - struct symbol *(*find_function)(struct dso *, u64 ip); + struct rb_root symbols[MAP__NR_TYPES]; + struct symbol *(*find_symbol)(struct dso *self, + enum map_type type, u64 addr); u8 adjust_symbols:1; u8 slen_calculated:1; u8 has_build_id:1; @@ -83,8 +84,6 @@ struct dso { struct dso *dso__new(const char *name); void dso__delete(struct dso *self); -struct symbol *dso__find_function(struct dso *self, u64 ip); - bool dso__loaded(const struct dso *self, enum map_type type); struct dso *dsos__findnew(const char *name); -- cgit v1.2.2