|
@@ -1085,6 +1085,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
|
|
OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
|
|
OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
|
|
"sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline, ..."
|
|
"sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline, ..."
|
|
" Please refer the man page for the complete list."),
|
|
" Please refer the man page for the complete list."),
|
|
|
|
+ OPT_STRING(0, "fields", &field_order, "key[,keys...]",
|
|
|
|
+ "output field(s): overhead, period, sample plus all of sort keys"),
|
|
OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
|
|
OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
|
|
"Show a column with the number of samples"),
|
|
"Show a column with the number of samples"),
|
|
OPT_CALLBACK_NOOPT('g', NULL, &top.record_opts,
|
|
OPT_CALLBACK_NOOPT('g', NULL, &top.record_opts,
|
|
@@ -1138,17 +1140,18 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
|
|
usage_with_options(top_usage, options);
|
|
usage_with_options(top_usage, options);
|
|
|
|
|
|
sort__mode = SORT_MODE__TOP;
|
|
sort__mode = SORT_MODE__TOP;
|
|
|
|
+ /* display thread wants entries to be collapsed in a different tree */
|
|
|
|
+ sort__need_collapse = 1;
|
|
|
|
|
|
if (setup_sorting() < 0) {
|
|
if (setup_sorting() < 0) {
|
|
- parse_options_usage(top_usage, options, "s", 1);
|
|
|
|
|
|
+ if (sort_order)
|
|
|
|
+ parse_options_usage(top_usage, options, "s", 1);
|
|
|
|
+ if (field_order)
|
|
|
|
+ parse_options_usage(sort_order ? NULL : top_usage,
|
|
|
|
+ options, "fields", 0);
|
|
goto out_delete_evlist;
|
|
goto out_delete_evlist;
|
|
}
|
|
}
|
|
|
|
|
|
- /* display thread wants entries to be collapsed in a different tree */
|
|
|
|
- sort__need_collapse = 1;
|
|
|
|
-
|
|
|
|
- perf_hpp__init();
|
|
|
|
-
|
|
|
|
if (top.use_stdio)
|
|
if (top.use_stdio)
|
|
use_browser = 0;
|
|
use_browser = 0;
|
|
else if (top.use_tui)
|
|
else if (top.use_tui)
|