From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756463AbcBCKWP (ORCPT ); Wed, 3 Feb 2016 05:22:15 -0500 Received: from terminus.zytor.com ([198.137.202.10]:54877 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbcBCKWL (ORCPT ); Wed, 3 Feb 2016 05:22:11 -0500 Date: Wed, 3 Feb 2016 02:21:21 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: acme@redhat.com, hpa@zytor.com, andi@firstfloor.org, dsahern@gmail.com, fweisbec@gmail.com, jolsa@kernel.org, peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, wangnan0@huawei.com, namhyung@kernel.org, mingo@kernel.org Reply-To: linux-kernel@vger.kernel.org, wangnan0@huawei.com, mingo@kernel.org, namhyung@kernel.org, tglx@linutronix.de, peterz@infradead.org, jolsa@kernel.org, dsahern@gmail.com, fweisbec@gmail.com, hpa@zytor.com, andi@firstfloor.org, acme@redhat.com In-Reply-To: <1453909257-26015-2-git-send-email-namhyung@kernel.org> References: <1453909257-26015-2-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists: Fix min callchain hits calculation Git-Commit-ID: 744070e0e4ac691bb43608f7bf46a9641a9cf342 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: 744070e0e4ac691bb43608f7bf46a9641a9cf342 Gitweb: http://git.kernel.org/tip/744070e0e4ac691bb43608f7bf46a9641a9cf342 Author: Namhyung Kim AuthorDate: Thu, 28 Jan 2016 00:40:48 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Feb 2016 16:42:31 -0300 perf hists: Fix min callchain hits calculation The total period should be get using hists__total_period() since it takes filtered entries into account. In addition, if callchain mode is 'fractal', the total period should be the entry's period. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1453909257-26015-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 81ce0af..b961946 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1163,9 +1163,18 @@ static void __hists__insert_output_entry(struct rb_root *entries, struct rb_node *parent = NULL; struct hist_entry *iter; - if (use_callchain) + if (use_callchain) { + if (callchain_param.mode == CHAIN_GRAPH_REL) { + u64 total = he->stat.period; + + if (symbol_conf.cumulate_callchain) + total = he->stat_acc->period; + + min_callchain_hits = total * (callchain_param.min_percent / 100); + } callchain_param.sort(&he->sorted_chain, he->callchain, min_callchain_hits, &callchain_param); + } while (*p != NULL) { parent = *p; @@ -1195,7 +1204,7 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog) else use_callchain = symbol_conf.use_callchain; - min_callchain_hits = hists->stats.total_period * (callchain_param.min_percent / 100); + min_callchain_hits = hists__total_period(hists) * (callchain_param.min_percent / 100); if (sort__need_collapse) root = &hists->entries_collapsed;