aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 9a6dbbff9a9f..06f763e4b35b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -120,7 +120,8 @@ static void parse_source(struct sym_entry *syme)
120 struct module *module; 120 struct module *module;
121 struct section *section = NULL; 121 struct section *section = NULL;
122 FILE *file; 122 FILE *file;
123 char command[PATH_MAX*2], *path = vmlinux; 123 char command[PATH_MAX*2];
124 const char *path = vmlinux_name;
124 u64 start, end, len; 125 u64 start, end, len;
125 126
126 if (!syme) 127 if (!syme)
@@ -487,10 +488,12 @@ static void print_sym_table(void)
487 ); 488 );
488 489
489 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) { 490 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
490 struct sym_entry *syme = rb_entry(nd, struct sym_entry, rb_node); 491 struct symbol *sym;
491 struct symbol *sym = (struct symbol *)(syme + 1);
492 double pcnt; 492 double pcnt;
493 493
494 syme = rb_entry(nd, struct sym_entry, rb_node);
495 sym = (struct symbol *)(syme + 1);
496
494 if (++printed > print_entries || (int)syme->snap_count < count_filter) 497 if (++printed > print_entries || (int)syme->snap_count < count_filter)
495 continue; 498 continue;
496 499
@@ -609,7 +612,7 @@ static void print_mapped_keys(void)
609 612
610 fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", count_filter); 613 fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", count_filter);
611 614
612 if (vmlinux) { 615 if (vmlinux_name) {
613 fprintf(stdout, "\t[F] annotate display filter (percent). \t(%d%%)\n", sym_pcnt_filter); 616 fprintf(stdout, "\t[F] annotate display filter (percent). \t(%d%%)\n", sym_pcnt_filter);
614 fprintf(stdout, "\t[s] annotate symbol. \t(%s)\n", name?: "NULL"); 617 fprintf(stdout, "\t[s] annotate symbol. \t(%s)\n", name?: "NULL");
615 fprintf(stdout, "\t[S] stop annotation.\n"); 618 fprintf(stdout, "\t[S] stop annotation.\n");
@@ -638,7 +641,9 @@ static int key_mapped(int c)
638 case 'F': 641 case 'F':
639 case 's': 642 case 's':
640 case 'S': 643 case 'S':
641 return vmlinux ? 1 : 0; 644 return vmlinux_name ? 1 : 0;
645 default:
646 break;
642 } 647 }
643 648
644 return 0; 649 return 0;
@@ -724,6 +729,8 @@ static void handle_keypress(int c)
724 case 'z': 729 case 'z':
725 zero = ~zero; 730 zero = ~zero;
726 break; 731 break;
732 default:
733 break;
727 } 734 }
728} 735}
729 736
@@ -812,13 +819,13 @@ static int parse_symbols(void)
812{ 819{
813 struct rb_node *node; 820 struct rb_node *node;
814 struct symbol *sym; 821 struct symbol *sym;
815 int modules = vmlinux ? 1 : 0; 822 int use_modules = vmlinux_name ? 1 : 0;
816 823
817 kernel_dso = dso__new("[kernel]", sizeof(struct sym_entry)); 824 kernel_dso = dso__new("[kernel]", sizeof(struct sym_entry));
818 if (kernel_dso == NULL) 825 if (kernel_dso == NULL)
819 return -1; 826 return -1;
820 827
821 if (dso__load_kernel(kernel_dso, vmlinux, symbol_filter, verbose, modules) <= 0) 828 if (dso__load_kernel(kernel_dso, vmlinux_name, symbol_filter, verbose, use_modules) <= 0)
822 goto out_delete_dso; 829 goto out_delete_dso;
823 830
824 node = rb_first(&kernel_dso->syms); 831 node = rb_first(&kernel_dso->syms);
@@ -1114,7 +1121,7 @@ static const struct option options[] = {
1114 "system-wide collection from all CPUs"), 1121 "system-wide collection from all CPUs"),
1115 OPT_INTEGER('C', "CPU", &profile_cpu, 1122 OPT_INTEGER('C', "CPU", &profile_cpu,
1116 "CPU to profile on"), 1123 "CPU to profile on"),
1117 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 1124 OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"),
1118 OPT_INTEGER('m', "mmap-pages", &mmap_pages, 1125 OPT_INTEGER('m', "mmap-pages", &mmap_pages,
1119 "number of mmap data pages"), 1126 "number of mmap data pages"),
1120 OPT_INTEGER('r', "realtime", &realtime_prio, 1127 OPT_INTEGER('r', "realtime", &realtime_prio,