aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0e83ffcbe55a..fe4aadc9630f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -38,7 +38,6 @@ static struct strlist *dso_list, *comm_list, *sym_list;
38 38
39static int force; 39static int force;
40static int input; 40static int input;
41static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
42 41
43static int full_paths; 42static int full_paths;
44static int show_nr_samples; 43static int show_nr_samples;
@@ -600,7 +599,6 @@ static int
600process_sample_event(event_t *event, unsigned long offset, unsigned long head) 599process_sample_event(event_t *event, unsigned long offset, unsigned long head)
601{ 600{
602 char level; 601 char level;
603 int show = 0;
604 struct symbol *sym = NULL; 602 struct symbol *sym = NULL;
605 struct thread *thread; 603 struct thread *thread;
606 u64 ip = event->ip.ip; 604 u64 ip = event->ip.ip;
@@ -657,42 +655,35 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
657 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 655 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
658 656
659 if (cpumode == PERF_RECORD_MISC_KERNEL) { 657 if (cpumode == PERF_RECORD_MISC_KERNEL) {
660 show = SHOW_KERNEL;
661 level = 'k'; 658 level = 'k';
662
663 sym = kernel_maps__find_symbol(ip, &map); 659 sym = kernel_maps__find_symbol(ip, &map);
664 dump_printf(" ...... dso: %s\n", 660 dump_printf(" ...... dso: %s\n",
665 map ? map->dso->long_name : "<not found>"); 661 map ? map->dso->long_name : "<not found>");
666 } else if (cpumode == PERF_RECORD_MISC_USER) { 662 } else if (cpumode == PERF_RECORD_MISC_USER) {
667
668 show = SHOW_USER;
669 level = '.'; 663 level = '.';
670 sym = resolve_symbol(thread, &map, &ip); 664 sym = resolve_symbol(thread, &map, &ip);
671 665
672 } else { 666 } else {
673 show = SHOW_HV;
674 level = 'H'; 667 level = 'H';
675
676 dump_printf(" ...... dso: [hypervisor]\n"); 668 dump_printf(" ...... dso: [hypervisor]\n");
677 } 669 }
678 670
679 if (show & show_mask) { 671 if (dso_list &&
680 if (dso_list && 672 (!map || !map->dso ||
681 (!map || !map->dso || 673 !(strlist__has_entry(dso_list, map->dso->short_name) ||
682 !(strlist__has_entry(dso_list, map->dso->short_name) || 674 (map->dso->short_name != map->dso->long_name &&
683 (map->dso->short_name != map->dso->long_name && 675 strlist__has_entry(dso_list, map->dso->long_name)))))
684 strlist__has_entry(dso_list, map->dso->long_name))))) 676 return 0;
685 return 0;
686 677
687 if (sym_list && sym && !strlist__has_entry(sym_list, sym->name)) 678 if (sym_list && sym && !strlist__has_entry(sym_list, sym->name))
688 return 0; 679 return 0;
689 680
690 if (hist_entry__add(thread, map, sym, ip, 681 if (hist_entry__add(thread, map, sym, ip,
691 chain, level, period)) { 682 chain, level, period)) {
692 eprintf("problem incrementing symbol count, skipping event\n"); 683 eprintf("problem incrementing symbol count, skipping event\n");
693 return -1; 684 return -1;
694 }
695 } 685 }
686
696 total += period; 687 total += period;
697 688
698 return 0; 689 return 0;