summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 0fb9bd8bcf0d..b146d87176e7 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1767,9 +1767,16 @@ struct map *map_groups__find_by_name(struct map_groups *mg, const char *name)
down_read(&maps->lock);
+ if (mg->last_search_by_name && strcmp(mg->last_search_by_name->dso->short_name, name) == 0) {
+ map = mg->last_search_by_name;
+ goto out_unlock;
+ }
+
maps__for_each_entry(maps, map)
- if (strcmp(map->dso->short_name, name) == 0)
+ if (strcmp(map->dso->short_name, name) == 0) {
+ mg->last_search_by_name = map;
goto out_unlock;
+ }
map = NULL;