From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758954AbcILOWp (ORCPT ); Mon, 12 Sep 2016 10:22:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:53470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755984AbcILOWo (ORCPT ); Mon, 12 Sep 2016 10:22:44 -0400 Date: Mon, 12 Sep 2016 11:22:28 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , Andi Kleen Subject: Re: [PATCH 4/7] perf hist: Initialize hierachy tree explicitly Message-ID: <20160912142228.GA4897@kernel.org> References: <20160912061958.16656-1-namhyung@kernel.org> <20160912061958.16656-5-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160912061958.16656-5-namhyung@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Sep 12, 2016 at 03:19:55PM +0900, Namhyung Kim escreveu: > The hroot_in and hroot_out are root of hiearchy tree of hist entry. But > as hist entry is initialized by copying existing template entry, it Which makes default_ops->new() pointing to a zalloc based constructor totally useless, right? I.e. we malloc() + bzero() to then imediatelly memcpy from the template :-) > sometimes has non-empty tree and copied it incorrectly. This is a > problem especially when event group is used since it creates dummy > entries from already-processed entries in other event members. I guess this needs a "Fixes:" probably for the changeset introducing those members :-\ - Arnaldo > Signed-off-by: Namhyung Kim > --- > 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 702ba3a8ead6..37a08f20730a 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; > -- > 2.9.3