]>
Commit | Line | Data |
---|---|---|
45426b3c GKH |
1 | From 97aa1052739c6a06cb6b0467dbf410613d20bc97 Mon Sep 17 00:00:00 2001 |
2 | From: Frederic Weisbecker <fweisbec@gmail.com> | |
3 | Date: Thu, 8 Jul 2010 06:06:17 +0200 | |
4 | Subject: perf: Resurrect flat callchains | |
5 | ||
6 | From: Frederic Weisbecker <fweisbec@gmail.com> | |
7 | ||
8 | commit 97aa1052739c6a06cb6b0467dbf410613d20bc97 upstream. | |
9 | ||
10 | Initialize the callchain radix tree root correctly. | |
11 | ||
12 | When we walk through the parents, we must stop after the root, but | |
13 | since it wasn't well initialized, its parent pointer was random. | |
14 | ||
15 | Also the number of hits was random because uninitialized, hence it | |
16 | was part of the callchain while the root doesn't contain anything. | |
17 | ||
18 | This fixes segfaults and percentages followed by empty callchains | |
19 | while running: | |
20 | ||
21 | perf report -g flat | |
22 | ||
23 | Reported-by: Ingo Molnar <mingo@elte.hu> | |
24 | Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> | |
25 | Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
26 | Cc: Arnaldo Carvalho de Melo <acme@redhat.com> | |
27 | Cc: Paul Mackerras <paulus@samba.org> | |
28 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
29 | ||
30 | --- | |
31 | tools/perf/util/callchain.h | 3 +++ | |
32 | 1 file changed, 3 insertions(+) | |
33 | ||
34 | --- a/tools/perf/util/callchain.h | |
35 | +++ b/tools/perf/util/callchain.h | |
36 | @@ -48,6 +48,9 @@ static inline void callchain_init(struct | |
37 | INIT_LIST_HEAD(&node->brothers); | |
38 | INIT_LIST_HEAD(&node->children); | |
39 | INIT_LIST_HEAD(&node->val); | |
40 | + | |
41 | + node->parent = NULL; | |
42 | + node->hit = 0; | |
43 | } | |
44 | ||
45 | static inline u64 cumul_hits(struct callchain_node *node) |