path: root/tools/perf/builtin-top.c
diff options
authorNamhyung Kim <>2015-10-22 23:28:32 +0900
committerArnaldo Carvalho de Melo <>2015-10-22 16:23:19 -0300
commit76a26549eb367f683fbb394b7246bef5dc665f8c (patch)
treec907aa970194a1d04c17318235be553035273342 /tools/perf/builtin-top.c
parent792aeafa8ed08e5e18fb66ab93b470f78e619f75 (diff)
perf tools: Improve call graph documents and help messages
The --call-graph option is complex so we should provide better guide for users. Also change help message to be consistent with config option names. Now perf top will show help like below: $ perf top --call-graph Error: option `call-graph' requires a value Usage: perf top [<options>] --call-graph <record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]> setup and enables call-graph (stack chain/backtrace): record_mode: call graph recording mode (fp|dwarf|lbr) record_size: if record_mode is 'dwarf', max size of stack recording (<bytes>) default: 8192 (bytes) print_type: call graph printing style (graph|flat|fractal|none) threshold: minimum call graph inclusion threshold (<percent>) print_limit: maximum number of call graph entry (<number>) order: call graph order (caller|callee) sort_key: call graph sort key (function|address) branch: include last branch info to call graph (branch) Default: fp,graph,0.5,caller,function Requested-by: Ingo Molnar <> Signed-off-by: Namhyung Kim <> Acked-by: Frederic Weisbecker <> Cc: Adrian Hunter <> Cc: Borislav Petkov <> Cc: Brendan Gregg <> Cc: Chandler Carruth <> Cc: David Ahern <> Cc: Jiri Olsa <> Cc: Peter Zijlstra <> Cc: Stephane Eranian <> Cc: Wang Nan <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-top.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index af849b1d7389..7e2e72e6d9d1 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1093,7 +1093,8 @@ parse_percent_limit(const struct option *opt, const char *arg,
return 0;
-const char top_callchain_help[] = CALLCHAIN_RECORD_HELP ", " CALLCHAIN_REPORT_HELP;
+const char top_callchain_help[] = CALLCHAIN_RECORD_HELP CALLCHAIN_REPORT_HELP
+ "\n\t\t\t\tDefault: fp,graph,0.5,caller,function";
int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
@@ -1173,7 +1174,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
NULL, "enables call-graph recording and display",
OPT_CALLBACK(0, "call-graph", &top.record_opts,
- "mode[,dump_size],output_type,min_percent[,print_limit],call_order[,branch]",
+ "record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]",
top_callchain_help, &parse_callchain_opt),
OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,
"Accumulate callchains of children and show total overhead as well"),