From 7e5e1b1404c30db5f6bc3f5203b6c21c1d244f99 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 26 Mar 2010 12:30:40 -0300 Subject: perf symbols: map_groups__find_symbol must return the map too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tools need to know from which map in the map_group a symbol was resolved to, so that, for isntance, we can annotate kernel modules symbols by getting its precise name, etc. Also add the _by_name variants for completeness. Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Paul Mackerras Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/map.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'tools/perf/util/map.h') diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 4e7a11da8ff..2031278cc06 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h @@ -119,13 +119,28 @@ static inline struct map *map_groups__find(struct map_groups *self, struct symbol *map_groups__find_symbol(struct map_groups *self, enum map_type type, u64 addr, + struct map **mapp, symbol_filter_t filter); -static inline struct symbol *map_groups__find_function(struct map_groups *self, - u64 addr, - symbol_filter_t filter) +struct symbol *map_groups__find_symbol_by_name(struct map_groups *self, + enum map_type type, + const char *name, + struct map **mapp, + symbol_filter_t filter); + +static inline +struct symbol *map_groups__find_function(struct map_groups *self, u64 addr, + struct map **mapp, symbol_filter_t filter) +{ + return map_groups__find_symbol(self, MAP__FUNCTION, addr, mapp, filter); +} + +static inline +struct symbol *map_groups__find_function_by_name(struct map_groups *self, + const char *name, struct map **mapp, + symbol_filter_t filter) { - return map_groups__find_symbol(self, MAP__FUNCTION, addr, filter); + return map_groups__find_symbol_by_name(self, MAP__FUNCTION, name, mapp, filter); } int map_groups__fixup_overlappings(struct map_groups *self, struct map *map, -- cgit v1.2.3-18-g5258