Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760537Ab0G3TLN (ORCPT ); Fri, 30 Jul 2010 15:11:13 -0400 Received: from kroah.org ([198.145.64.141]:51461 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753988Ab0G3RSX (ORCPT ); Fri, 30 Jul 2010 13:18:23 -0400 X-Mailbox-Line: From gregkh@clark.site Fri Jul 30 10:15:03 2010 Message-Id: <20100730171503.653088001@clark.site> User-Agent: quilt/0.48-11.2 Date: Fri, 30 Jul 2010 10:14:32 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Frederic Weisbecker , Peter Zijlstra , Arnaldo Carvalho de Melo , Paul Mackerras Subject: [044/165] perf: Resurrect flat callchains In-Reply-To: <20100730171550.GA1299@kroah.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1568 Lines: 51 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Frederic Weisbecker 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 Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Paul Mackerras Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/callchain.h | 3 +++ 1 file changed, 3 insertions(+) --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h @@ -48,6 +48,9 @@ static inline void callchain_init(struct 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) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/