perf top: Add --hierarchy option
Support hierarchy output for perf-top using --hierarchy option. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Pekka Enberg <penberg@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1456326830-30456-19-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
5d8200ae67
commit
c92fcfde34
@ -233,6 +233,9 @@ Default is to monitor all CPUS.
|
|||||||
--raw-trace::
|
--raw-trace::
|
||||||
When displaying traceevent output, do not use print fmt or plugins.
|
When displaying traceevent output, do not use print fmt or plugins.
|
||||||
|
|
||||||
|
--hierarchy::
|
||||||
|
Enable hierarchy output.
|
||||||
|
|
||||||
INTERACTIVE PROMPTING KEYS
|
INTERACTIVE PROMPTING KEYS
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
@ -1214,6 +1214,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
|
|||||||
parse_branch_stack),
|
parse_branch_stack),
|
||||||
OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace,
|
OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace,
|
||||||
"Show raw trace event output (do not use print fmt or plugins)"),
|
"Show raw trace event output (do not use print fmt or plugins)"),
|
||||||
|
OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy,
|
||||||
|
"Show entries in a hierarchy"),
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
const char * const top_usage[] = {
|
const char * const top_usage[] = {
|
||||||
@ -1241,6 +1243,19 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
|
|||||||
goto out_delete_evlist;
|
goto out_delete_evlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (symbol_conf.report_hierarchy) {
|
||||||
|
/* disable incompatible options */
|
||||||
|
symbol_conf.event_group = false;
|
||||||
|
symbol_conf.cumulate_callchain = false;
|
||||||
|
|
||||||
|
if (field_order) {
|
||||||
|
pr_err("Error: --hierarchy and --fields options cannot be used together\n");
|
||||||
|
parse_options_usage(top_usage, options, "fields", 0);
|
||||||
|
parse_options_usage(NULL, options, "hierarchy", 0);
|
||||||
|
goto out_delete_evlist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sort__mode = SORT_MODE__TOP;
|
sort__mode = SORT_MODE__TOP;
|
||||||
/* display thread wants entries to be collapsed in a different tree */
|
/* display thread wants entries to be collapsed in a different tree */
|
||||||
sort__need_collapse = 1;
|
sort__need_collapse = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user