Skip to contentSkip to conversation

perf top: Fix symbol annotation

PATCH In review Arnaldo Carvalho de Melo 1 participant 2 messages Oct 20, 2009 – Oct 24, 2009 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
---
 tools/perf/builtin-top.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
tools/perf/builtin-top.c +4 -3
index cc66286..fa20345 100644
@@ -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);
Signature · 1 line
1.5.5.1
#1 lore raw
Commit-ID:  c88e4bf60de6253a048cf4e6b3b0715e543e0460
Gitweb:     http://git.kernel.org/tip/c88e4bf60de6253a048cf4e6b3b0715e543e0460
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 20 Oct 2009 15:54:55 -0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 20 Oct 2009 21:12:59 +0200

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.

Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/builtin-top.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
tools/perf/builtin-top.c +4 -3
index cc66286..fa20345 100644
@@ -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);