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>
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0e83ffc..fe4aadc 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -38,7 +38,6 @@
static int force;
static int input;
-static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
static int full_paths;
static int show_nr_samples;
@@ -600,7 +599,6 @@
process_sample_event(event_t *event, unsigned long offset, unsigned long head)
{
char level;
- int show = 0;
struct symbol *sym = NULL;
struct thread *thread;
u64 ip = event->ip.ip;
@@ -657,42 +655,35 @@
cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
if (cpumode == PERF_RECORD_MISC_KERNEL) {
- show = SHOW_KERNEL;
level = 'k';
-
sym = kernel_maps__find_symbol(ip, &map);
dump_printf(" ...... dso: %s\n",
map ? map->dso->long_name : "<not found>");
} else if (cpumode == PERF_RECORD_MISC_USER) {
-
- show = SHOW_USER;
level = '.';
sym = resolve_symbol(thread, &map, &ip);
} else {
- show = SHOW_HV;
level = 'H';
-
dump_printf(" ...... dso: [hypervisor]\n");
}
- if (show & show_mask) {
- if (dso_list &&
- (!map || !map->dso ||
- !(strlist__has_entry(dso_list, map->dso->short_name) ||
- (map->dso->short_name != map->dso->long_name &&
- strlist__has_entry(dso_list, map->dso->long_name)))))
- return 0;
+ if (dso_list &&
+ (!map || !map->dso ||
+ !(strlist__has_entry(dso_list, map->dso->short_name) ||
+ (map->dso->short_name != map->dso->long_name &&
+ strlist__has_entry(dso_list, map->dso->long_name)))))
+ return 0;
- if (sym_list && sym && !strlist__has_entry(sym_list, sym->name))
- return 0;
+ if (sym_list && sym && !strlist__has_entry(sym_list, sym->name))
+ return 0;
- if (hist_entry__add(thread, map, sym, ip,
- chain, level, period)) {
- eprintf("problem incrementing symbol count, skipping event\n");
- return -1;
- }
+ if (hist_entry__add(thread, map, sym, ip,
+ chain, level, period)) {
+ eprintf("problem incrementing symbol count, skipping event\n");
+ return -1;
}
+
total += period;
return 0;