diff options
author | Anton Blanchard <anton@samba.org> | 2014-09-08 18:59:29 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-09-17 16:08:10 -0400 |
commit | d0b0d0406fe6743e734e1ba780155f8db5f713e6 (patch) | |
tree | bfcfc7526ab33adf7a21ccdc5dc088db29864afa /tools/perf/util/symbol-elf.c | |
parent | 512fe365373b9c95a70b4b6357503ee74d27214f (diff) |
perf symbols: Ignore stripped vmlinux and fallback to kallsyms
If a vmlinux is stripped, perf will use it and ignore kallsyms. We
end up with useless profiles where everything maps to a few
runtime symbols:
63.39% swapper [kernel.kallsyms] [k] hcall_real_table
4.90% beam.smp [kernel.kallsyms] [k] hcall_real_table
4.44% beam.smp [kernel.kallsyms] [k] __sched_text_start
3.72% beam.smp [kernel.kallsyms] [k] __run_at_kexec
Detect this case and fallback to using kallsyms. This fixes the issue:
62.81% swapper [kernel.kallsyms] [k] snooze_loop
4.44% beam.smp [kernel.kallsyms] [k] __schedule
0.91% beam.smp [kernel.kallsyms] [k] _switch
0.73% beam.smp [kernel.kallsyms] [k] put_prev_entity
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20140909085929.4a5a81f0@kryten
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol-elf.c')
-rw-r--r-- | tools/perf/util/symbol-elf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 9c9b27fbc78d..2a92e10317c5 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -717,6 +717,14 @@ int dso__load_sym(struct dso *dso, struct map *map, | |||
717 | symbols__delete(&dso->symbols[map->type]); | 717 | symbols__delete(&dso->symbols[map->type]); |
718 | 718 | ||
719 | if (!syms_ss->symtab) { | 719 | if (!syms_ss->symtab) { |
720 | /* | ||
721 | * If the vmlinux is stripped, fail so we will fall back | ||
722 | * to using kallsyms. The vmlinux runtime symbols aren't | ||
723 | * of much use. | ||
724 | */ | ||
725 | if (dso->kernel) | ||
726 | goto out_elf_end; | ||
727 | |||
720 | syms_ss->symtab = syms_ss->dynsym; | 728 | syms_ss->symtab = syms_ss->dynsym; |
721 | syms_ss->symshdr = syms_ss->dynshdr; | 729 | syms_ss->symshdr = syms_ss->dynshdr; |
722 | } | 730 | } |