aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.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-report.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-report.c')
-rw-r--r--tools/perf/builtin-report.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0af48401f089..0d39e805be2d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -449,7 +449,7 @@ got_map:
449 * trick of looking in the whole kernel symbol list. 449 * trick of looking in the whole kernel symbol list.
450 */ 450 */
451 if ((long long)ip < 0) 451 if ((long long)ip < 0)
452 return kernel_maps__find_symbol(ip, mapp); 452 return kernel_maps__find_symbol(ip, mapp, NULL);
453 } 453 }
454 dump_printf(" ...... dso: %s\n", 454 dump_printf(" ...... dso: %s\n",
455 map ? map->dso->long_name : "<not found>"); 455 map ? map->dso->long_name : "<not found>");
@@ -496,7 +496,7 @@ static struct symbol **resolve_callchain(struct thread *thread, struct map *map,
496 case PERF_CONTEXT_HV: 496 case PERF_CONTEXT_HV:
497 break; 497 break;
498 case PERF_CONTEXT_KERNEL: 498 case PERF_CONTEXT_KERNEL:
499 sym = kernel_maps__find_symbol(ip, &map); 499 sym = kernel_maps__find_symbol(ip, &map, NULL);
500 break; 500 break;
501 default: 501 default:
502 sym = resolve_symbol(thread, &map, &ip); 502 sym = resolve_symbol(thread, &map, &ip);
@@ -716,7 +716,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
716 716
717 if (cpumode == PERF_RECORD_MISC_KERNEL) { 717 if (cpumode == PERF_RECORD_MISC_KERNEL) {
718 level = 'k'; 718 level = 'k';
719 sym = kernel_maps__find_symbol(ip, &map); 719 sym = kernel_maps__find_symbol(ip, &map, NULL);
720 dump_printf(" ...... dso: %s\n", 720 dump_printf(" ...... dso: %s\n",
721 map ? map->dso->long_name : "<not found>"); 721 map ? map->dso->long_name : "<not found>");
722 } else if (cpumode == PERF_RECORD_MISC_USER) { 722 } else if (cpumode == PERF_RECORD_MISC_USER) {