Skip to content

Commit 6581f6e

Browse files
namhyungacmel
authored andcommitted
perf report: Document '--call-graph' for optional print_limit argument
The '--call-graph' command line option can receive undocumented optional print_limit argument. Besides, use strtoul() to parse the option since its type is u32. Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1323703017-6060-2-git-send-email-namhyung@gmail.com Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent f3bda2c commit 6581f6e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎tools/perf/Documentation/perf-report.txt‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ OPTIONS
8080
--dump-raw-trace::
8181
Dump raw trace in ASCII.
8282

83-
-g [type,min,order]::
83+
-g [type,min[,limit],order]::
8484
--call-graph::
85-
Display call chains using type, min percent threshold and order.
85+
Display call chains using type, min percent threshold, optional print
86+
limit and order.
8687
type can be either:
8788
- flat: single column, linear exposure of call chains.
8889
- graph: use a graph tree, displaying absolute overhead rates.

‎tools/perf/builtin-report.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
407407
goto setup;
408408

409409
if (tok2[0] != 'c') {
410-
callchain_param.print_limit = strtod(tok2, &endptr);
410+
callchain_param.print_limit = strtoul(tok2, &endptr, 0);
411411
tok2 = strtok(NULL, ",");
412412
if (!tok2)
413413
goto setup;
@@ -485,8 +485,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
485485
"regex filter to identify parent, see: '--sort parent'"),
486486
OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
487487
"Only display entries with parent-match"),
488-
OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent, call_order",
489-
"Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold and callchain order. "
488+
OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order",
489+
"Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit and callchain order. "
490490
"Default: fractal,0.5,callee", &parse_callchain_opt, callchain_default_opt),
491491
OPT_BOOLEAN('G', "inverted", &report.inverted_callchain,
492492
"alias for inverted call graph"),

0 commit comments

Comments
 (0)