struct symbol *map_groups__find_symbol(struct map_groups *self,
enum map_type type, u64 addr,
+ struct map **mapp,
symbol_filter_t filter)
{
struct map *map = map_groups__find(self, type, addr);
- if (map != NULL)
+ if (map != NULL) {
+ if (mapp != NULL)
+ *mapp = map;
return map__find_symbol(map, map->map_ip(map, addr), filter);
+ }
+
+ return NULL;
+}
+
+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)
+{
+ struct rb_node *nd;
+
+ for (nd = rb_first(&self->maps[type]); nd; nd = rb_next(nd)) {
+ struct map *pos = rb_entry(nd, struct map, rb_node);
+ struct symbol *sym = map__find_symbol_by_name(pos, name, filter);
+
+ if (sym == NULL)
+ continue;
+ if (mapp != NULL)
+ *mapp = pos;
+ return sym;
+ }
return NULL;
}
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,