diff options
author | Namhyung Kim <namhyung@kernel.org> | 2013-10-30 04:05:55 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-06-01 08:35:04 -0400 |
commit | 793aaaabb79803a0154fc6a98c472a29bb6d5cc9 (patch) | |
tree | 7e0f3b9584830fb4fabb43dabde567af71dbd6d8 | |
parent | 77284de326e6d8c3b8e866cda5b415c86b522e61 (diff) |
perf report: Add --children option
The --children option is for showing accumulated overhead (period)
value as well as self overhead.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arun Sharma <asharma@fb.com>
Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1401335910-16832-16-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
-rw-r--r-- | tools/perf/Documentation/perf-report.txt | 7 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 15 |
2 files changed, 20 insertions, 2 deletions
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index a1b5185402d5..cefdf430d1b4 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt | |||
@@ -111,7 +111,7 @@ OPTIONS | |||
111 | --fields=:: | 111 | --fields=:: |
112 | Specify output field - multiple keys can be specified in CSV format. | 112 | Specify output field - multiple keys can be specified in CSV format. |
113 | Following fields are available: | 113 | Following fields are available: |
114 | overhead, overhead_sys, overhead_us, sample and period. | 114 | overhead, overhead_sys, overhead_us, overhead_children, sample and period. |
115 | Also it can contain any sort key(s). | 115 | Also it can contain any sort key(s). |
116 | 116 | ||
117 | By default, every sort keys not specified in -F will be appended | 117 | By default, every sort keys not specified in -F will be appended |
@@ -163,6 +163,11 @@ OPTIONS | |||
163 | 163 | ||
164 | Default: fractal,0.5,callee,function. | 164 | Default: fractal,0.5,callee,function. |
165 | 165 | ||
166 | --children:: | ||
167 | Accumulate callchain of children to parent entry so that then can | ||
168 | show up in the output. The output will have a new "Children" column | ||
169 | and will be sorted on the data. It requires callchains are recorded. | ||
170 | |||
166 | --max-stack:: | 171 | --max-stack:: |
167 | Set the stack depth limit when parsing the callchain, anything | 172 | Set the stack depth limit when parsing the callchain, anything |
168 | beyond the specified depth will be ignored. This is a trade-off | 173 | beyond the specified depth will be ignored. This is a trade-off |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index e8fa9fea341f..f27a8aad6a3f 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -185,6 +185,14 @@ static int report__setup_sample_type(struct report *rep) | |||
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
188 | if (symbol_conf.cumulate_callchain) { | ||
189 | /* Silently ignore if callchain is missing */ | ||
190 | if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) { | ||
191 | symbol_conf.cumulate_callchain = false; | ||
192 | perf_hpp__cancel_cumulate(); | ||
193 | } | ||
194 | } | ||
195 | |||
188 | if (sort__mode == SORT_MODE__BRANCH) { | 196 | if (sort__mode == SORT_MODE__BRANCH) { |
189 | if (!is_pipe && | 197 | if (!is_pipe && |
190 | !(sample_type & PERF_SAMPLE_BRANCH_STACK)) { | 198 | !(sample_type & PERF_SAMPLE_BRANCH_STACK)) { |
@@ -568,6 +576,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) | |||
568 | OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order", | 576 | OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order", |
569 | "Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit, callchain order, key (function or address). " | 577 | "Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit, callchain order, key (function or address). " |
570 | "Default: fractal,0.5,callee,function", &report_parse_callchain_opt, callchain_default_opt), | 578 | "Default: fractal,0.5,callee,function", &report_parse_callchain_opt, callchain_default_opt), |
579 | OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain, | ||
580 | "Accumulate callchains of children and show total overhead as well"), | ||
571 | OPT_INTEGER(0, "max-stack", &report.max_stack, | 581 | OPT_INTEGER(0, "max-stack", &report.max_stack, |
572 | "Set the maximum stack depth when parsing the callchain, " | 582 | "Set the maximum stack depth when parsing the callchain, " |
573 | "anything beyond the specified depth will be ignored. " | 583 | "anything beyond the specified depth will be ignored. " |
@@ -660,8 +670,10 @@ repeat: | |||
660 | has_br_stack = perf_header__has_feat(&session->header, | 670 | has_br_stack = perf_header__has_feat(&session->header, |
661 | HEADER_BRANCH_STACK); | 671 | HEADER_BRANCH_STACK); |
662 | 672 | ||
663 | if (branch_mode == -1 && has_br_stack) | 673 | if (branch_mode == -1 && has_br_stack) { |
664 | sort__mode = SORT_MODE__BRANCH; | 674 | sort__mode = SORT_MODE__BRANCH; |
675 | symbol_conf.cumulate_callchain = false; | ||
676 | } | ||
665 | 677 | ||
666 | if (report.mem_mode) { | 678 | if (report.mem_mode) { |
667 | if (sort__mode == SORT_MODE__BRANCH) { | 679 | if (sort__mode == SORT_MODE__BRANCH) { |
@@ -669,6 +681,7 @@ repeat: | |||
669 | goto error; | 681 | goto error; |
670 | } | 682 | } |
671 | sort__mode = SORT_MODE__MEMORY; | 683 | sort__mode = SORT_MODE__MEMORY; |
684 | symbol_conf.cumulate_callchain = false; | ||
672 | } | 685 | } |
673 | 686 | ||
674 | if (setup_sorting() < 0) { | 687 | if (setup_sorting() < 0) { |