aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-06-30 19:01:20 -0300
committerIngo Molnar <mingo@elte.hu>2009-07-01 00:07:09 +0200
commit25903407da21552419e0955705d6d8c8e601cb2e (patch)
tree5270f2817f367d9f4930983f7395612621b0b0c8 /tools/perf/builtin-report.c
parentf5812a7a336fb952d819e4427b9a2dce02368e82 (diff)
perf report: Add --dsos parameter
So that we can filter by dso. Symbols in other dsos won't be accounted for. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1246399282-20934-2-git-send-email-acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ed391db9e0f..7c6b6e77671 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -16,6 +16,7 @@
#include "util/symbol.h"
#include "util/string.h"
#include "util/callchain.h"
+#include "util/strlist.h"
#include "perf.h"
#include "util/header.h"
@@ -32,6 +33,8 @@ static char *vmlinux = NULL;
static char default_sort_order[] = "comm,dso";
static char *sort_order = default_sort_order;
+static char *dso_list_str;
+static struct strlist *dso_list;
static int input;
static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
@@ -1272,6 +1275,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
if (show & show_mask) {
struct symbol *sym = resolve_symbol(thread, &map, &dso, &ip);
+ if (dso_list && dso && dso->name && !strlist__has_entry(dso_list, dso->name))
+ return 0;
+
if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) {
eprintf("problem incrementing symbol count, skipping event\n");
return -1;
@@ -1659,6 +1665,8 @@ static const struct option options[] = {
OPT_BOOLEAN('x', "exclude-other", &exclude_other,
"Only display entries with parent-match"),
OPT_BOOLEAN('c', "callchain", &callchain, "Display callchains"),
+ OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]",
+ "only consider symbols in these dsos"),
OPT_END()
};
@@ -1698,6 +1706,14 @@ int cmd_report(int argc, const char **argv, const char *prefix)
if (argc)
usage_with_options(report_usage, options);
+ if (dso_list_str) {
+ dso_list = strlist__new(true, dso_list_str);
+ if (!dso_list) {
+ fprintf(stderr, "problems parsing dso list\n");
+ exit(129);
+ }
+ }
+
setup_pager();
return __cmd_report();