diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-09-12 15:10:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-09-12 15:10:05 -0400 |
commit | cb48b6a26cace226d8b299a48c73e808eb0c4f61 (patch) | |
tree | baf3600125c5b9937d9f5903b56e7e7651a0c2ec /tools/perf | |
parent | 02e184476eff848273826c1d6617bb37e5bcc7ad (diff) | |
parent | 03db8b583d1c3c84963e08e2abf6c79081da5c31 (diff) |
Merge tag 'perf-urgent-for-mingo-4.19-20180912' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
- Fix finding a symbol by name when multiple maps use the same backing DSO,
so we must first see if that symbol name is in the DSO, then see if it is
inside the range of addresses for that specific map (Adrian Hunter)
- Update the tools copies of UAPI headers, which silences the warnings
emitted when building the tools and in some cases, like for the new
KVM ioctls, results in 'perf trace' being able to translate that
ioctl number to a string (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/map.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 36d0763311ef..6a6929f208b4 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -576,6 +576,13 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg, | |||
576 | return NULL; | 576 | return NULL; |
577 | } | 577 | } |
578 | 578 | ||
579 | static bool map__contains_symbol(struct map *map, struct symbol *sym) | ||
580 | { | ||
581 | u64 ip = map->unmap_ip(map, sym->start); | ||
582 | |||
583 | return ip >= map->start && ip < map->end; | ||
584 | } | ||
585 | |||
579 | struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, | 586 | struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, |
580 | struct map **mapp) | 587 | struct map **mapp) |
581 | { | 588 | { |
@@ -591,6 +598,10 @@ struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, | |||
591 | 598 | ||
592 | if (sym == NULL) | 599 | if (sym == NULL) |
593 | continue; | 600 | continue; |
601 | if (!map__contains_symbol(pos, sym)) { | ||
602 | sym = NULL; | ||
603 | continue; | ||
604 | } | ||
594 | if (mapp != NULL) | 605 | if (mapp != NULL) |
595 | *mapp = pos; | 606 | *mapp = pos; |
596 | goto out; | 607 | goto out; |