From: Arnaldo Carvalho de Melo Date: Tue, 20 Oct 2009 17:54:55 +0000 (-0200) Subject: perf top: Fix symbol annotation X-Git-Tag: firefly_0821_release~9833^2~3628^2~310^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c88e4bf60de6253a048cf4e6b3b0715e543e0460;p=firefly-linux-kernel-4.4.55.git perf top: Fix symbol annotation We need to use map->unmap_ip() here too to match section relative symbol address to the absolute address needed to match objdump -dS addresses. Reported-by: Mike Galbraith Signed-off-by: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Paul Mackerras LKML-Reference: <1256061295-19835-1-git-send-email-acme@redhat.com> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index cc6628630303..fa20345a0ab0 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -141,7 +141,8 @@ static void parse_source(struct sym_entry *syme) sprintf(command, "objdump --start-address=0x%016Lx " "--stop-address=0x%016Lx -dS %s", - sym->start, sym->end, path); + map->unmap_ip(map, sym->start), + map->unmap_ip(map, sym->end), path); file = popen(command, "r"); if (!file) @@ -173,11 +174,11 @@ static void parse_source(struct sym_entry *syme) if (strlen(src->line)>8 && src->line[8] == ':') { src->eip = strtoull(src->line, NULL, 16); - src->eip += map->start; + src->eip = map->unmap_ip(map, src->eip); } if (strlen(src->line)>8 && src->line[16] == ':') { src->eip = strtoull(src->line, NULL, 16); - src->eip += map->start; + src->eip = map->unmap_ip(map, src->eip); } } pclose(file);