aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-20 17:51:27 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-21 08:11:33 -0500
commitc338aee853db197e1855b393e6d6cc667784537f (patch)
treef97fea21c608a689144302b8dd78ef29bfaa5c88 /tools/perf/builtin-annotate.c
parent78075caad99dc36ec6ef5826b7a5273ea14295fc (diff)
perf symbols: Do lazy symtab loading for the kernel & modules too
Just like we do with the other DSOs. This also simplifies the kernel_maps setup process, now all that the tools need to do is to call kernel_maps__init and the maps for the modules and kernel will be created, then, later, when kernel_maps__find_symbol() is used, it will also call maps__find_symbol that already checks if the symtab was loaded, loading it if needed. Now if one does 'perf top --hide_kernel_symbols' we won't pay the price of loading the (many) symbols in /proc/kallsyms or vmlinux. 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: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1258757489-5978-4-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index b6da1476ab1b..203152729a68 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -157,7 +157,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
157 157
158 if (event->header.misc & PERF_RECORD_MISC_KERNEL) { 158 if (event->header.misc & PERF_RECORD_MISC_KERNEL) {
159 level = 'k'; 159 level = 'k';
160 sym = kernel_maps__find_symbol(ip, &map); 160 sym = kernel_maps__find_symbol(ip, &map, symbol_filter);
161 dump_printf(" ...... dso: %s\n", 161 dump_printf(" ...... dso: %s\n",
162 map ? map->dso->long_name : "<not found>"); 162 map ? map->dso->long_name : "<not found>");
163 } else if (event->header.misc & PERF_RECORD_MISC_USER) { 163 } else if (event->header.misc & PERF_RECORD_MISC_USER) {
@@ -637,9 +637,9 @@ static int __cmd_annotate(void)
637 exit(0); 637 exit(0);
638 } 638 }
639 639
640 if (load_kernel(symbol_filter, use_modules) < 0) { 640 if (kernel_maps__init(use_modules) < 0) {
641 perror("failed to load kernel symbols"); 641 pr_err("failed to create kernel maps for symbol resolution\b");
642 return EXIT_FAILURE; 642 return -1;
643 } 643 }
644 644
645remap: 645remap: