diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 89c95289fd51..bc0eec1ce4be 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -699,10 +699,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) | |||
699 | OPT_BOOLEAN(0, "header-only", &report.header_only, | 699 | OPT_BOOLEAN(0, "header-only", &report.header_only, |
700 | "Show only data header."), | 700 | "Show only data header."), |
701 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", | 701 | OPT_STRING('s', "sort", &sort_order, "key[,key2...]", |
702 | "sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline," | 702 | "sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline, ..." |
703 | " dso_to, dso_from, symbol_to, symbol_from, mispredict," | 703 | " Please refer the man page for the complete list."), |
704 | " weight, local_weight, mem, symbol_daddr, dso_daddr, tlb, " | 704 | OPT_STRING('F', "fields", &field_order, "key[,keys...]", |
705 | "snoop, locked, abort, in_tx, transaction"), | 705 | "output field(s): overhead, period, sample plus all of sort keys"), |
706 | OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, | 706 | OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, |
707 | "Show sample percentage for different cpu modes"), | 707 | "Show sample percentage for different cpu modes"), |
708 | OPT_STRING('p', "parent", &parent_pattern, "regex", | 708 | OPT_STRING('p', "parent", &parent_pattern, "regex", |
@@ -807,52 +807,31 @@ repeat: | |||
807 | if (branch_mode == -1 && has_br_stack) | 807 | if (branch_mode == -1 && has_br_stack) |
808 | sort__mode = SORT_MODE__BRANCH; | 808 | sort__mode = SORT_MODE__BRANCH; |
809 | 809 | ||
810 | /* sort__mode could be NORMAL if --no-branch-stack */ | ||
811 | if (sort__mode == SORT_MODE__BRANCH) { | ||
812 | /* | ||
813 | * if no sort_order is provided, then specify | ||
814 | * branch-mode specific order | ||
815 | */ | ||
816 | if (sort_order == default_sort_order) | ||
817 | sort_order = "comm,dso_from,symbol_from," | ||
818 | "dso_to,symbol_to"; | ||
819 | |||
820 | } | ||
821 | if (report.mem_mode) { | 810 | if (report.mem_mode) { |
822 | if (sort__mode == SORT_MODE__BRANCH) { | 811 | if (sort__mode == SORT_MODE__BRANCH) { |
823 | pr_err("branch and mem mode incompatible\n"); | 812 | pr_err("branch and mem mode incompatible\n"); |
824 | goto error; | 813 | goto error; |
825 | } | 814 | } |
826 | sort__mode = SORT_MODE__MEMORY; | 815 | sort__mode = SORT_MODE__MEMORY; |
827 | |||
828 | /* | ||
829 | * if no sort_order is provided, then specify | ||
830 | * branch-mode specific order | ||
831 | */ | ||
832 | if (sort_order == default_sort_order) | ||
833 | sort_order = "local_weight,mem,sym,dso,symbol_daddr,dso_daddr,snoop,tlb,locked"; | ||
834 | } | 816 | } |
835 | 817 | ||
836 | if (setup_sorting() < 0) { | 818 | if (setup_sorting() < 0) { |
837 | parse_options_usage(report_usage, options, "s", 1); | 819 | if (sort_order) |
820 | parse_options_usage(report_usage, options, "s", 1); | ||
821 | if (field_order) | ||
822 | parse_options_usage(sort_order ? NULL : report_usage, | ||
823 | options, "F", 1); | ||
838 | goto error; | 824 | goto error; |
839 | } | 825 | } |
840 | 826 | ||
841 | if (parent_pattern != default_parent_pattern) { | ||
842 | if (sort_dimension__add("parent") < 0) | ||
843 | goto error; | ||
844 | } | ||
845 | |||
846 | /* Force tty output for header output. */ | 827 | /* Force tty output for header output. */ |
847 | if (report.header || report.header_only) | 828 | if (report.header || report.header_only) |
848 | use_browser = 0; | 829 | use_browser = 0; |
849 | 830 | ||
850 | if (strcmp(input_name, "-") != 0) | 831 | if (strcmp(input_name, "-") != 0) |
851 | setup_browser(true); | 832 | setup_browser(true); |
852 | else { | 833 | else |
853 | use_browser = 0; | 834 | use_browser = 0; |
854 | perf_hpp__init(); | ||
855 | } | ||
856 | 835 | ||
857 | if (report.header || report.header_only) { | 836 | if (report.header || report.header_only) { |
858 | perf_session__fprintf_info(session, stdout, | 837 | perf_session__fprintf_info(session, stdout, |