aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.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/symbol.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/symbol.c')
-rw-r--r--tools/perf/util/symbol.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index faa84f5d4f54..3350119f6909 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -337,7 +337,7 @@ static int kernel_maps__split_kallsyms(symbol_filter_t filter, int use_modules)
337 return -1; 337 return -1;
338 } 338 }
339 339
340 map->map_ip = vdso__map_ip; 340 map->map_ip = map->unmap_ip = identity__map_ip;
341 kernel_maps__insert(map); 341 kernel_maps__insert(map);
342 ++kernel_range; 342 ++kernel_range;
343 } 343 }
@@ -790,7 +790,8 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
790 dso__delete(curr_dso); 790 dso__delete(curr_dso);
791 goto out_elf_end; 791 goto out_elf_end;
792 } 792 }
793 curr_map->map_ip = vdso__map_ip; 793 curr_map->map_ip = identity__map_ip;
794 curr_map->unmap_ip = identity__map_ip;
794 curr_dso->origin = DSO__ORIG_KERNEL; 795 curr_dso->origin = DSO__ORIG_KERNEL;
795 kernel_maps__insert(curr_map); 796 kernel_maps__insert(curr_map);
796 dsos__add(curr_dso); 797 dsos__add(curr_dso);
@@ -1158,6 +1159,7 @@ static struct map *map__new2(u64 start, struct dso *dso)
1158 self->pgoff = 0; 1159 self->pgoff = 0;
1159 self->dso = dso; 1160 self->dso = dso;
1160 self->map_ip = map__map_ip; 1161 self->map_ip = map__map_ip;
1162 self->unmap_ip = map__unmap_ip;
1161 RB_CLEAR_NODE(&self->rb_node); 1163 RB_CLEAR_NODE(&self->rb_node);
1162 } 1164 }
1163 return self; 1165 return self;
@@ -1259,7 +1261,7 @@ int dsos__load_kernel(const char *vmlinux, unsigned int sym_priv_size,
1259 if (kernel_map == NULL) 1261 if (kernel_map == NULL)
1260 goto out_delete_dso; 1262 goto out_delete_dso;
1261 1263
1262 kernel_map->map_ip = vdso__map_ip; 1264 kernel_map->map_ip = kernel_map->unmap_ip = identity__map_ip;
1263 1265
1264 if (use_modules && dsos__load_modules(sym_priv_size) < 0) { 1266 if (use_modules && dsos__load_modules(sym_priv_size) < 0) {
1265 fprintf(stderr, "Failed to load list of modules in use! " 1267 fprintf(stderr, "Failed to load list of modules in use! "