Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754419AbbLJHyY (ORCPT ); Thu, 10 Dec 2015 02:54:24 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:46321 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753746AbbLJHxn (ORCPT ); Thu, 10 Dec 2015 02:53:43 -0500 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Frederic Weisbecker , Andi Kleen , Stephane Eranian , Adrian Hunter Subject: [PATCH/RFC 09/16] perf tools: Update hist entry's hists pointer Date: Thu, 10 Dec 2015 16:53:28 +0900 Message-Id: <1449734015-9148-10-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1449734015-9148-1-git-send-email-namhyung@kernel.org> References: <1449734015-9148-1-git-send-email-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 37 When sample is processed using multi-thread, each sample is gathered on each thread's hist tree and then merged into the real hist tree. But hist_entry->hists pointer was not updated so it could refer wrong hists resulted in missing outputs. Signed-off-by: Namhyung Kim --- tools/perf/util/hist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index ea4f3ad978b0..a12e5022fe04 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1008,6 +1008,14 @@ bool hists__collapse_insert_entry(struct hists *hists __maybe_unused, } hists->nr_entries++; + /* + * If a hist entry is processed in multi-threaded environment, + * it points to a dummy local hists which was used only for + * intermidate processing. So update it to a real one so that + * it can find the correct info later. + */ + he->hists = hists; + rb_link_node(&he->rb_node_in, parent, p); rb_insert_color(&he->rb_node_in, root); return true; -- 2.6.2 -- 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/