From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755138AbcITVkd (ORCPT ); Tue, 20 Sep 2016 17:40:33 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39020 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754841AbcITVkb (ORCPT ); Tue, 20 Sep 2016 17:40:31 -0400 Date: Tue, 20 Sep 2016 14:40:18 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: jolsa@kernel.org, a.p.zijlstra@chello.nl, mingo@kernel.org, namhyung@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, andi@firstfloor.org, hpa@zytor.com, tglx@linutronix.de Reply-To: andi@firstfloor.org, hpa@zytor.com, tglx@linutronix.de, acme@redhat.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org In-Reply-To: <20160913074552.13284-4-namhyung@kernel.org> References: <20160913074552.13284-4-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hist: Initialize hierarchy tree explicitly Git-Commit-ID: d2580c7a5b4e78bffda1e53cfd583e7a2c7383a5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d2580c7a5b4e78bffda1e53cfd583e7a2c7383a5 Gitweb: http://git.kernel.org/tip/d2580c7a5b4e78bffda1e53cfd583e7a2c7383a5 Author: Namhyung Kim AuthorDate: Tue, 13 Sep 2016 16:45:48 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 13 Sep 2016 16:36:46 -0300 perf hist: Initialize hierarchy tree explicitly The hroot_in and hroot_out are roots of hierarchy trees of hist entries. But when a hist entry is initialized by copying existing template entry, it sometimes has non-empty tree and copies it incorrectly. This is a problem especially when an event group is used since it creates dummy entries from already-processed entries in other event members. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20160913074552.13284-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 702ba3a..37a08f2 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -417,6 +417,8 @@ static int hist_entry__init(struct hist_entry *he, } INIT_LIST_HEAD(&he->pairs.node); thread__get(he->thread); + he->hroot_in = RB_ROOT; + he->hroot_out = RB_ROOT; if (!symbol_conf.report_hierarchy) he->leaf = true;