diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-07-08 06:06:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-02 10:29:43 -0700 |
commit | da98098137f1ec05921117c0da8ad156036b74d2 (patch) | |
tree | 93e24262a00fac3909db53a77215e3fed7fe3713 /tools | |
parent | ddf7095df25ba6d2b1dce8513c5cec250653ae05 (diff) |
perf: Resurrect flat callchains
commit 97aa1052739c6a06cb6b0467dbf410613d20bc97 upstream.
Initialize the callchain radix tree root correctly.
When we walk through the parents, we must stop after the root, but
since it wasn't well initialized, its parent pointer was random.
Also the number of hits was random because uninitialized, hence it
was part of the callchain while the root doesn't contain anything.
This fixes segfaults and percentages followed by empty callchains
while running:
perf report -g flat
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/callchain.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index ad4626de4c2..1b7a3897825 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h @@ -48,6 +48,9 @@ static inline void callchain_init(struct callchain_node *node) INIT_LIST_HEAD(&node->brothers); INIT_LIST_HEAD(&node->children); INIT_LIST_HEAD(&node->val); + + node->parent = NULL; + node->hit = 0; } static inline u64 cumul_hits(struct callchain_node *node) |