aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Documentation/perf-report.txt4
-rw-r--r--tools/perf/builtin-report.c33
2 files changed, 27 insertions, 10 deletions
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 13d85ca8c914..4c44ef1747b9 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -24,6 +24,10 @@ OPTIONS
24--dsos=:: 24--dsos=::
25 Only consider symbols in these dsos. CSV that understands 25 Only consider symbols in these dsos. CSV that understands
26 file://filename entries. 26 file://filename entries.
27-C::
28--comms=::
29 Only consider symbols in these comms. CSV that understands
30 file://filename entries.
27 31
28SEE ALSO 32SEE ALSO
29-------- 33--------
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 7c6b6e776718..8143477b7ef7 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -33,8 +33,8 @@ static char *vmlinux = NULL;
33 33
34static char default_sort_order[] = "comm,dso"; 34static char default_sort_order[] = "comm,dso";
35static char *sort_order = default_sort_order; 35static char *sort_order = default_sort_order;
36static char *dso_list_str; 36static char *dso_list_str, *comm_list_str;
37static struct strlist *dso_list; 37static struct strlist *dso_list, *comm_list;
38 38
39static int input; 39static int input;
40static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; 40static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
@@ -240,7 +240,7 @@ static u64 vdso__map_ip(struct map *map, u64 ip)
240 240
241static inline int is_anon_memory(const char *filename) 241static inline int is_anon_memory(const char *filename)
242{ 242{
243 return strcmp(filename, "//anon") == 0; 243 return strcmp(filename, "//anon") == 0;
244} 244}
245 245
246static struct map *map__new(struct mmap_event *event) 246static struct map *map__new(struct mmap_event *event)
@@ -1253,6 +1253,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1253 return -1; 1253 return -1;
1254 } 1254 }
1255 1255
1256 if (comm_list && !strlist__has_entry(comm_list, thread->comm))
1257 return 0;
1258
1256 if (event->header.misc & PERF_EVENT_MISC_KERNEL) { 1259 if (event->header.misc & PERF_EVENT_MISC_KERNEL) {
1257 show = SHOW_KERNEL; 1260 show = SHOW_KERNEL;
1258 level = 'k'; 1261 level = 'k';
@@ -1667,6 +1670,8 @@ static const struct option options[] = {
1667 OPT_BOOLEAN('c', "callchain", &callchain, "Display callchains"), 1670 OPT_BOOLEAN('c', "callchain", &callchain, "Display callchains"),
1668 OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]", 1671 OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]",
1669 "only consider symbols in these dsos"), 1672 "only consider symbols in these dsos"),
1673 OPT_STRING('C', "comms", &comm_list_str, "comm[,comm...]",
1674 "only consider symbols in these comms"),
1670 OPT_END() 1675 OPT_END()
1671}; 1676};
1672 1677
@@ -1685,6 +1690,19 @@ static void setup_sorting(void)
1685 free(str); 1690 free(str);
1686} 1691}
1687 1692
1693static void setup_list(struct strlist **list, const char *list_str,
1694 const char *list_name)
1695{
1696 if (list_str) {
1697 *list = strlist__new(true, list_str);
1698 if (!*list) {
1699 fprintf(stderr, "problems parsing %s list\n",
1700 list_name);
1701 exit(129);
1702 }
1703 }
1704}
1705
1688int cmd_report(int argc, const char **argv, const char *prefix) 1706int cmd_report(int argc, const char **argv, const char *prefix)
1689{ 1707{
1690 symbol__init(); 1708 symbol__init();
@@ -1706,13 +1724,8 @@ int cmd_report(int argc, const char **argv, const char *prefix)
1706 if (argc) 1724 if (argc)
1707 usage_with_options(report_usage, options); 1725 usage_with_options(report_usage, options);
1708 1726
1709 if (dso_list_str) { 1727 setup_list(&dso_list, dso_list_str, "dso");
1710 dso_list = strlist__new(true, dso_list_str); 1728 setup_list(&comm_list, comm_list_str, "comm");
1711 if (!dso_list) {
1712 fprintf(stderr, "problems parsing dso list\n");
1713 exit(129);
1714 }
1715 }
1716 1729
1717 setup_pager(); 1730 setup_pager();
1718 1731