aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 77d50a6d6802..6b13a1ecf1e7 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -33,9 +33,11 @@ static int input;
33static int full_paths; 33static int full_paths;
34 34
35static int print_line; 35static int print_line;
36static bool use_modules;
36 37
37static unsigned long page_size; 38static unsigned long page_size;
38static unsigned long mmap_window = 32; 39static unsigned long mmap_window = 32;
40const char *vmlinux_name;
39 41
40struct sym_hist { 42struct sym_hist {
41 u64 sum; 43 u64 sum;
@@ -156,7 +158,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
156 158
157 if (event->header.misc & PERF_RECORD_MISC_KERNEL) { 159 if (event->header.misc & PERF_RECORD_MISC_KERNEL) {
158 level = 'k'; 160 level = 'k';
159 sym = kernel_maps__find_symbol(ip, &map); 161 sym = kernel_maps__find_symbol(ip, &map, symbol_filter);
160 dump_printf(" ...... dso: %s\n", 162 dump_printf(" ...... dso: %s\n",
161 map ? map->dso->long_name : "<not found>"); 163 map ? map->dso->long_name : "<not found>");
162 } else if (event->header.misc & PERF_RECORD_MISC_USER) { 164 } else if (event->header.misc & PERF_RECORD_MISC_USER) {
@@ -636,9 +638,9 @@ static int __cmd_annotate(void)
636 exit(0); 638 exit(0);
637 } 639 }
638 640
639 if (load_kernel(symbol_filter) < 0) { 641 if (kernel_maps__init(vmlinux_name, true, use_modules) < 0) {
640 perror("failed to load kernel symbols"); 642 pr_err("failed to create kernel maps for symbol resolution\b");
641 return EXIT_FAILURE; 643 return -1;
642 } 644 }
643 645
644remap: 646remap:
@@ -742,7 +744,7 @@ static const struct option options[] = {
742 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 744 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
743 "dump raw trace in ASCII"), 745 "dump raw trace in ASCII"),
744 OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), 746 OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"),
745 OPT_BOOLEAN('m', "modules", &modules, 747 OPT_BOOLEAN('m', "modules", &use_modules,
746 "load module symbols - WARNING: use only with -k and LIVE kernel"), 748 "load module symbols - WARNING: use only with -k and LIVE kernel"),
747 OPT_BOOLEAN('l', "print-line", &print_line, 749 OPT_BOOLEAN('l', "print-line", &print_line,
748 "print matching source lines (may be slow)"), 750 "print matching source lines (may be slow)"),