aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2015-10-22 10:28:32 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-10-22 15:23:19 -0400
commit76a26549eb367f683fbb394b7246bef5dc665f8c (patch)
treec907aa970194a1d04c17318235be553035273342 /tools/perf/builtin-report.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 <mingo@kernel.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Chandler Carruth <chandlerc@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1445524112-5201-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 545c51cef7f7..50dd4d3d8667 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -625,8 +625,11 @@ parse_percent_limit(const struct option *opt, const char *str,
625 return 0; 625 return 0;
626} 626}
627 627
628const char report_callchain_help[] = "Display callchains using " CALLCHAIN_REPORT_HELP ". " 628#define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function"
629 "Default: graph,0.5,caller"; 629
630const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
631 CALLCHAIN_REPORT_HELP
632 "\n\t\t\t\tDefault: " CALLCHAIN_DEFAULT_OPT;
630 633
631int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) 634int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
632{ 635{
@@ -636,7 +639,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
636 bool has_br_stack = false; 639 bool has_br_stack = false;
637 int branch_mode = -1; 640 int branch_mode = -1;
638 bool branch_call_mode = false; 641 bool branch_call_mode = false;
639 char callchain_default_opt[] = "graph,0.5,caller"; 642 char callchain_default_opt[] = CALLCHAIN_DEFAULT_OPT;
640 const char * const report_usage[] = { 643 const char * const report_usage[] = {
641 "perf report [<options>]", 644 "perf report [<options>]",
642 NULL 645 NULL
@@ -703,7 +706,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
703 OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, 706 OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
704 "Only display entries with parent-match"), 707 "Only display entries with parent-match"),
705 OPT_CALLBACK_DEFAULT('g', "call-graph", &report, 708 OPT_CALLBACK_DEFAULT('g', "call-graph", &report,
706 "output_type,min_percent[,print_limit],call_order[,branch]", 709 "print_type,threshold[,print_limit],order,sort_key[,branch]",
707 report_callchain_help, &report_parse_callchain_opt, 710 report_callchain_help, &report_parse_callchain_opt,
708 callchain_default_opt), 711 callchain_default_opt),
709 OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain, 712 OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,