Commit 6275ce2d authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar

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: default avatarArnaldo 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: default avatarIngo Molnar <mingo@elte.hu>
parent 9de89fe7
...@@ -1011,7 +1011,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, ...@@ -1011,7 +1011,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
if (curr_dso == NULL) if (curr_dso == NULL)
goto out_elf_end; goto out_elf_end;
curr_map = map__new2(start, curr_dso, curr_map = map__new2(start, curr_dso,
MAP__FUNCTION); map->type);
if (curr_map == NULL) { if (curr_map == NULL) {
dso__delete(curr_dso); dso__delete(curr_dso);
goto out_elf_end; goto out_elf_end;
...@@ -1021,6 +1021,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, ...@@ -1021,6 +1021,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
curr_dso->origin = DSO__ORIG_KERNEL; curr_dso->origin = DSO__ORIG_KERNEL;
map_groups__insert(kmap->kmaps, curr_map); map_groups__insert(kmap->kmaps, curr_map);
dsos__add(&dsos__kernel, curr_dso); dsos__add(&dsos__kernel, curr_dso);
dso__set_loaded(curr_dso, map->type);
} else } else
curr_dso = curr_map->dso; curr_dso = curr_map->dso;
...@@ -1058,8 +1059,16 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, ...@@ -1058,8 +1059,16 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
/* /*
* For misannotated, zeroed, ASM function sizes. * For misannotated, zeroed, ASM function sizes.
*/ */
if (nr > 0) if (nr > 0) {
symbols__fixup_end(&self->symbols[map->type]); symbols__fixup_end(&self->symbols[map->type]);
if (kmap) {
/*
* We need to fixup this here too because we create new
* maps here, for things like vsyscall sections.
*/
__map_groups__fixup_end(kmap->kmaps, map->type);
}
}
err = nr; err = nr;
out_elf_end: out_elf_end:
elf_end(elf); elf_end(elf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment