]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.17/perf-resurrect-flat-callchains.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / perf-resurrect-flat-callchains.patch
CommitLineData
45426b3c
GKH
1From 97aa1052739c6a06cb6b0467dbf410613d20bc97 Mon Sep 17 00:00:00 2001
2From: Frederic Weisbecker <fweisbec@gmail.com>
3Date: Thu, 8 Jul 2010 06:06:17 +0200
4Subject: perf: Resurrect flat callchains
5
6From: Frederic Weisbecker <fweisbec@gmail.com>
7
8commit 97aa1052739c6a06cb6b0467dbf410613d20bc97 upstream.
9
10Initialize the callchain radix tree root correctly.
11
12When we walk through the parents, we must stop after the root, but
13since it wasn't well initialized, its parent pointer was random.
14
15Also the number of hits was random because uninitialized, hence it
16was part of the callchain while the root doesn't contain anything.
17
18This fixes segfaults and percentages followed by empty callchains
19while running:
20
21 perf report -g flat
22
23Reported-by: Ingo Molnar <mingo@elte.hu>
24Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
25Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
26Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
27Cc: Paul Mackerras <paulus@samba.org>
28Signed-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)