diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 33 |
1 files changed, 23 insertions, 10 deletions
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 | ||
34 | static char default_sort_order[] = "comm,dso"; | 34 | static char default_sort_order[] = "comm,dso"; |
35 | static char *sort_order = default_sort_order; | 35 | static char *sort_order = default_sort_order; |
36 | static char *dso_list_str; | 36 | static char *dso_list_str, *comm_list_str; |
37 | static struct strlist *dso_list; | 37 | static struct strlist *dso_list, *comm_list; |
38 | 38 | ||
39 | static int input; | 39 | static int input; |
40 | static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; | 40 | static 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 | ||
241 | static inline int is_anon_memory(const char *filename) | 241 | static 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 | ||
246 | static struct map *map__new(struct mmap_event *event) | 246 | static 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 | ||
1693 | static 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 | |||
1688 | int cmd_report(int argc, const char **argv, const char *prefix) | 1706 | int 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 | ||