diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-10-03 19:30:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-04 13:37:11 -0400 |
commit | ec218fc4a796a1b584741d59ef22615d96981188 (patch) | |
tree | 59e1060af0aa674d32bb81701bd08802209ef416 /tools/perf/builtin-report.c | |
parent | 9735abf11bec48bfbbb1b54772a02deb2ae0c403 (diff) |
perf tools: Remove show_mask bitmask
As it was not being exposed via any command line and with --dsos/--comms
we can do this and even more, like asking for just kernel + some module:
[root@doppio linux-2.6-tip]# perf report --dsos \[kernel\],\[drm\]
--vmlinux /home/acme/git/build/tip-recvmmsg/vmlinux --modules | head -15
# Samples: 619669
#
# Overhead Command Shared Object Symbol
# ........ ............... ............. ......
#
7.12% swapper [kernel] [k] read_hpet
6.86% init [kernel] [k] read_hpet
6.22% init [kernel] [k] mwait_idle_with_hints
5.34% swapper [kernel] [k] mwait_idle_with_hints
3.01% firefox [kernel] [.] vread_hpet
2.14% Xorg [drm] [k] drm_clflush_pages
2.09% pidgin [kernel] [.] vread_hpet
1.58% npviewer.bin [kernel] [.] vread_hpet
1.37% swapper [kernel] [k] hpet_next_event
1.23% Xorg [kernel] [k] read_hpet
[root@doppio linux-2.6-tip]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <20091003233048.GA30535@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 35 |
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 | ||
39 | static int force; | 39 | static int force; |
40 | static int input; | 40 | static int input; |
41 | static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; | ||
42 | 41 | ||
43 | static int full_paths; | 42 | static int full_paths; |
44 | static int show_nr_samples; | 43 | static int show_nr_samples; |
@@ -600,7 +599,6 @@ static int | |||
600 | process_sample_event(event_t *event, unsigned long offset, unsigned long head) | 599 | process_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; |