aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-07 01:11:05 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-09 06:54:33 -0400
commit1953287bfe8afcbbd235bd6c42c9df06d52438dc (patch)
tree7428a4f33fe3509d7a705706df4f3c688266e19f /tools/perf/builtin-report.c
parent836179834833272f89098c6d1e1b89e8e69797c2 (diff)
perf tools: Fix call-chain cumul hit based sub-total (fractal mode)
The callchain fractal mode builds each new total hits in a new branch of profiling by using the parent's hits of the current branch plus the hits of the children. This is wrong, the total hits of a branch should be made of the sum of every children hits, we must ignore the parent hits in this scope. This patch also fixes another mistake with the hit counting. Now the rates are correct. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8cb58d68a006..da402e186561 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -901,7 +901,7 @@ callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
901 int i; 901 int i;
902 902
903 if (callchain_param.mode == CHAIN_GRAPH_REL) 903 if (callchain_param.mode == CHAIN_GRAPH_REL)
904 new_total = self->cumul_hit; 904 new_total = self->children_hit;
905 else 905 else
906 new_total = total_samples; 906 new_total = total_samples;
907 907
@@ -930,7 +930,7 @@ callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
930 ret += ipchain__fprintf_graph(fp, chain, depth, 930 ret += ipchain__fprintf_graph(fp, chain, depth,
931 new_depth_mask, i++, 931 new_depth_mask, i++,
932 new_total, 932 new_total,
933 child->cumul_hit); 933 cumul_hits(child));
934 } 934 }
935 ret += callchain__fprintf_graph(fp, child, new_total, 935 ret += callchain__fprintf_graph(fp, child, new_total,
936 depth + 1, 936 depth + 1,