diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-02-03 13:52:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-04 03:33:25 -0500 |
commit | 6275ce2d5f44ae4f8575c24724525cbb2a3a141b (patch) | |
tree | 3fda31e5846a6d72fda2418ab161f7d360b7ba48 /tools/perf | |
parent | 9de89fe7c577847877ae00ea1aa6315559b10243 (diff) |
perf symbols: Fixup vsyscall maps
While debugging a problem reported by Pekka Enberg by printing
the IP and all the maps for a thread when we don't find a map
for an IP I noticed that dso__load_sym needs to fixup these
extra maps it creates to hold symbols in different ELF sections
than the main kernel one.
Now we're back showing things like:
[root@doppio linux-2.6-tip]# perf report | grep vsyscall
0.02% mutt [kernel.kallsyms].vsyscall_fn [.] vread_hpet
0.01% named [kernel.kallsyms].vsyscall_fn [.] vread_hpet
0.01% NetworkManager [kernel.kallsyms].vsyscall_fn [.] vread_hpet
0.01% gconfd-2 [kernel.kallsyms].vsyscall_0 [.] vgettimeofday
0.01% hald-addon-rfki [kernel.kallsyms].vsyscall_fn [.] vread_hpet
0.00% dbus-daemon [kernel.kallsyms].vsyscall_fn [.] vread_hpet
[root@doppio linux-2.6-tip]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1265223128-11786-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/symbol.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 613874260761..051d71b33df0 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1011,7 +1011,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, | |||
1011 | if (curr_dso == NULL) | 1011 | if (curr_dso == NULL) |
1012 | goto out_elf_end; | 1012 | goto out_elf_end; |
1013 | curr_map = map__new2(start, curr_dso, | 1013 | curr_map = map__new2(start, curr_dso, |
1014 | MAP__FUNCTION); | 1014 | map->type); |
1015 | if (curr_map == NULL) { | 1015 | if (curr_map == NULL) { |
1016 | dso__delete(curr_dso); | 1016 | dso__delete(curr_dso); |
1017 | goto out_elf_end; | 1017 | goto out_elf_end; |
@@ -1021,6 +1021,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, | |||
1021 | curr_dso->origin = DSO__ORIG_KERNEL; | 1021 | curr_dso->origin = DSO__ORIG_KERNEL; |
1022 | map_groups__insert(kmap->kmaps, curr_map); | 1022 | map_groups__insert(kmap->kmaps, curr_map); |
1023 | dsos__add(&dsos__kernel, curr_dso); | 1023 | dsos__add(&dsos__kernel, curr_dso); |
1024 | dso__set_loaded(curr_dso, map->type); | ||
1024 | } else | 1025 | } else |
1025 | curr_dso = curr_map->dso; | 1026 | curr_dso = curr_map->dso; |
1026 | 1027 | ||
@@ -1058,8 +1059,16 @@ new_symbol: | |||
1058 | /* | 1059 | /* |
1059 | * For misannotated, zeroed, ASM function sizes. | 1060 | * For misannotated, zeroed, ASM function sizes. |
1060 | */ | 1061 | */ |
1061 | if (nr > 0) | 1062 | if (nr > 0) { |
1062 | symbols__fixup_end(&self->symbols[map->type]); | 1063 | symbols__fixup_end(&self->symbols[map->type]); |
1064 | if (kmap) { | ||
1065 | /* | ||
1066 | * We need to fixup this here too because we create new | ||
1067 | * maps here, for things like vsyscall sections. | ||
1068 | */ | ||
1069 | __map_groups__fixup_end(kmap->kmaps, map->type); | ||
1070 | } | ||
1071 | } | ||
1063 | err = nr; | 1072 | err = nr; |
1064 | out_elf_end: | 1073 | out_elf_end: |
1065 | elf_end(elf); | 1074 | elf_end(elf); |