aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-10-19 15:17:57 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-20 01:55:51 -0400
commited52ce2e3c33dc7626a40fa2da766d1a6460e543 (patch)
tree037f7791b8f493b1adc27d9f9692922ed886844e /tools/perf/util/map.c
parentbbe2987bea26a684ff11d887dfc4cf39b22c27a2 (diff)
perf tools: Add ->unmap_ip operation to struct map
We need this because we get section relative addresses when reading the symtabs, but when a tool like 'perf annotate' needs to match these address to what 'objdump -dS' produces we need the address + section back again. So in annotate now we look at the 'struct hist_entry' instances (that weren't really being used) so that we iterate only over the symbols that had some hit and get the map where that particular hit happened so that we can get the right address to match with annotate. Verified that at least: perf annotate mmap_read_counter # Uses the ~/bin/perf binary perf annotate --vmlinux /home/acme/git/build/perf/vmlinux intel_pmu_enable_all on a 'perf record perf top' session seems to work. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Mike Galbraith <efault@gmx.de> LKML-Reference: <1255979877-12533-1-git-send-email-acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 804e02382739..4e203d144f9e 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -54,9 +54,11 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
54 goto out_delete; 54 goto out_delete;
55 55
56 if (self->dso == vdso || anon) 56 if (self->dso == vdso || anon)
57 self->map_ip = vdso__map_ip; 57 self->map_ip = self->unmap_ip = identity__map_ip;
58 else 58 else {
59 self->map_ip = map__map_ip; 59 self->map_ip = map__map_ip;
60 self->unmap_ip = map__unmap_ip;
61 }
60 } 62 }
61 return self; 63 return self;
62out_delete: 64out_delete: