diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 8e91c6eba18a..2e317438980b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -40,7 +40,7 @@ struct perf_report { | |||
40 | struct perf_tool tool; | 40 | struct perf_tool tool; |
41 | struct perf_session *session; | 41 | struct perf_session *session; |
42 | char const *input_name; | 42 | char const *input_name; |
43 | bool force, use_tui, use_stdio; | 43 | bool force, use_tui, use_gtk, use_stdio; |
44 | bool hide_unresolved; | 44 | bool hide_unresolved; |
45 | bool dont_use_callchains; | 45 | bool dont_use_callchains; |
46 | bool show_full_info; | 46 | bool show_full_info; |
@@ -50,6 +50,7 @@ struct perf_report { | |||
50 | const char *pretty_printing_style; | 50 | const char *pretty_printing_style; |
51 | symbol_filter_t annotate_init; | 51 | symbol_filter_t annotate_init; |
52 | const char *cpu_list; | 52 | const char *cpu_list; |
53 | const char *symbol_filter_str; | ||
53 | DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); | 54 | DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); |
54 | }; | 55 | }; |
55 | 56 | ||
@@ -400,6 +401,9 @@ static int __cmd_report(struct perf_report *rep) | |||
400 | list_for_each_entry(pos, &session->evlist->entries, node) { | 401 | list_for_each_entry(pos, &session->evlist->entries, node) { |
401 | struct hists *hists = &pos->hists; | 402 | struct hists *hists = &pos->hists; |
402 | 403 | ||
404 | if (pos->idx == 0) | ||
405 | hists->symbol_filter_str = rep->symbol_filter_str; | ||
406 | |||
403 | hists__collapse_resort(hists); | 407 | hists__collapse_resort(hists); |
404 | hists__output_resort(hists); | 408 | hists__output_resort(hists); |
405 | nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE]; | 409 | nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE]; |
@@ -411,8 +415,13 @@ static int __cmd_report(struct perf_report *rep) | |||
411 | } | 415 | } |
412 | 416 | ||
413 | if (use_browser > 0) { | 417 | if (use_browser > 0) { |
414 | perf_evlist__tui_browse_hists(session->evlist, help, | 418 | if (use_browser == 1) { |
415 | NULL, NULL, 0); | 419 | perf_evlist__tui_browse_hists(session->evlist, help, |
420 | NULL, NULL, 0); | ||
421 | } else if (use_browser == 2) { | ||
422 | perf_evlist__gtk_browse_hists(session->evlist, help, | ||
423 | NULL, NULL, 0); | ||
424 | } | ||
416 | } else | 425 | } else |
417 | perf_evlist__tty_browse_hists(session->evlist, rep, help); | 426 | perf_evlist__tty_browse_hists(session->evlist, rep, help); |
418 | 427 | ||
@@ -569,6 +578,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
569 | OPT_STRING(0, "pretty", &report.pretty_printing_style, "key", | 578 | OPT_STRING(0, "pretty", &report.pretty_printing_style, "key", |
570 | "pretty printing style key: normal raw"), | 579 | "pretty printing style key: normal raw"), |
571 | OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"), | 580 | OPT_BOOLEAN(0, "tui", &report.use_tui, "Use the TUI interface"), |
581 | OPT_BOOLEAN(0, "gtk", &report.use_gtk, "Use the GTK2 interface"), | ||
572 | OPT_BOOLEAN(0, "stdio", &report.use_stdio, | 582 | OPT_BOOLEAN(0, "stdio", &report.use_stdio, |
573 | "Use the stdio interface"), | 583 | "Use the stdio interface"), |
574 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", | 584 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", |
@@ -591,6 +601,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
591 | "only consider symbols in these comms"), | 601 | "only consider symbols in these comms"), |
592 | OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]", | 602 | OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]", |
593 | "only consider these symbols"), | 603 | "only consider these symbols"), |
604 | OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter", | ||
605 | "only show symbols that (partially) match with this filter"), | ||
594 | OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, | 606 | OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, |
595 | "width[,width...]", | 607 | "width[,width...]", |
596 | "don't try to adjust column width, use these fixed values"), | 608 | "don't try to adjust column width, use these fixed values"), |
@@ -624,6 +636,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
624 | use_browser = 0; | 636 | use_browser = 0; |
625 | else if (report.use_tui) | 637 | else if (report.use_tui) |
626 | use_browser = 1; | 638 | use_browser = 1; |
639 | else if (report.use_gtk) | ||
640 | use_browser = 2; | ||
627 | 641 | ||
628 | if (report.inverted_callchain) | 642 | if (report.inverted_callchain) |
629 | callchain_param.order = ORDER_CALLER; | 643 | callchain_param.order = ORDER_CALLER; |
@@ -660,7 +674,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
660 | } | 674 | } |
661 | 675 | ||
662 | if (strcmp(report.input_name, "-") != 0) { | 676 | if (strcmp(report.input_name, "-") != 0) { |
663 | setup_browser(true); | 677 | if (report.use_gtk) |
678 | perf_gtk_setup_browser(argc, argv, true); | ||
679 | else | ||
680 | setup_browser(true); | ||
664 | } else { | 681 | } else { |
665 | use_browser = 0; | 682 | use_browser = 0; |
666 | } | 683 | } |
@@ -709,11 +726,16 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
709 | } else | 726 | } else |
710 | symbol_conf.exclude_other = false; | 727 | symbol_conf.exclude_other = false; |
711 | 728 | ||
712 | /* | 729 | if (argc) { |
713 | * Any (unrecognized) arguments left? | 730 | /* |
714 | */ | 731 | * Special case: if there's an argument left then assume that |
715 | if (argc) | 732 | * it's a symbol filter: |
716 | usage_with_options(report_usage, options); | 733 | */ |
734 | if (argc > 1) | ||
735 | usage_with_options(report_usage, options); | ||
736 | |||
737 | report.symbol_filter_str = argv[0]; | ||
738 | } | ||
717 | 739 | ||
718 | sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list, "comm", stdout); | 740 | sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list, "comm", stdout); |
719 | 741 | ||