aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-06-30 18:01:20 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-30 18:07:09 -0400
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 ed391db9e0f8..7c6b6e776718 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -16,6 +16,7 @@
16#include "util/symbol.h" 16#include "util/symbol.h"
17#include "util/string.h" 17#include "util/string.h"
18#include "util/callchain.h" 18#include "util/callchain.h"
19#include "util/strlist.h"
19 20
20#include "perf.h" 21#include "perf.h"
21#include "util/header.h" 22#include "util/header.h"
@@ -32,6 +33,8 @@ static char *vmlinux = NULL;
32 33
33static char default_sort_order[] = "comm,dso"; 34static char default_sort_order[] = "comm,dso";
34static char *sort_order = default_sort_order; 35static char *sort_order = default_sort_order;
36static char *dso_list_str;
37static struct strlist *dso_list;
35 38
36static int input; 39static int input;
37static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; 40static 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)
1272 if (show & show_mask) { 1275 if (show & show_mask) {
1273 struct symbol *sym = resolve_symbol(thread, &map, &dso, &ip); 1276 struct symbol *sym = resolve_symbol(thread, &map, &dso, &ip);
1274 1277
1278 if (dso_list && dso && dso->name && !strlist__has_entry(dso_list, dso->name))
1279 return 0;
1280
1275 if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) { 1281 if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) {
1276 eprintf("problem incrementing symbol count, skipping event\n"); 1282 eprintf("problem incrementing symbol count, skipping event\n");
1277 return -1; 1283 return -1;
@@ -1659,6 +1665,8 @@ static const struct option options[] = {
1659 OPT_BOOLEAN('x', "exclude-other", &exclude_other, 1665 OPT_BOOLEAN('x', "exclude-other", &exclude_other,
1660 "Only display entries with parent-match"), 1666 "Only display entries with parent-match"),
1661 OPT_BOOLEAN('c', "callchain", &callchain, "Display callchains"), 1667 OPT_BOOLEAN('c', "callchain", &callchain, "Display callchains"),
1668 OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]",
1669 "only consider symbols in these dsos"),
1662 OPT_END() 1670 OPT_END()
1663}; 1671};
1664 1672
@@ -1698,6 +1706,14 @@ int cmd_report(int argc, const char **argv, const char *prefix)
1698 if (argc) 1706 if (argc)
1699 usage_with_options(report_usage, options); 1707 usage_with_options(report_usage, options);
1700 1708
1709 if (dso_list_str) {
1710 dso_list = strlist__new(true, dso_list_str);
1711 if (!dso_list) {
1712 fprintf(stderr, "problems parsing dso list\n");
1713 exit(129);
1714 }
1715 }
1716
1701 setup_pager(); 1717 setup_pager();
1702 1718
1703 return __cmd_report(); 1719 return __cmd_report();