perf report: Add -F option to specify output fields
[deliverable/linux.git] / tools / perf / builtin-report.c
index c4dab7acbdbbe6a35599c565e40e98d15c3db7ff..bc0eec1ce4beaba37509f731c79f8e1855796c08 100644 (file)
@@ -701,6 +701,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
        OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
                   "sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline, ..."
                   " Please refer the man page for the complete list."),
+       OPT_STRING('F', "fields", &field_order, "key[,keys...]",
+                  "output field(s): overhead, period, sample plus all of sort keys"),
        OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization,
                    "Show sample percentage for different cpu modes"),
        OPT_STRING('p', "parent", &parent_pattern, "regex",
@@ -814,17 +816,14 @@ repeat:
        }
 
        if (setup_sorting() < 0) {
-               parse_options_usage(report_usage, options, "s", 1);
+               if (sort_order)
+                       parse_options_usage(report_usage, options, "s", 1);
+               if (field_order)
+                       parse_options_usage(sort_order ? NULL : report_usage,
+                                           options, "F", 1);
                goto error;
        }
 
-       if (parent_pattern != default_parent_pattern) {
-               if (sort_dimension__add("parent") < 0)
-                       goto error;
-       }
-
-       perf_hpp__init();
-
        /* Force tty output for header output. */
        if (report.header || report.header_only)
                use_browser = 0;
This page took 0.024574 seconds and 5 git commands to generate.