From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965501AbcIVPlR (ORCPT ); Thu, 22 Sep 2016 11:41:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36210 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965332AbcIVPjX (ORCPT ); Thu, 22 Sep 2016 11:39:23 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Don Zickus , Joe Mario , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: [PATCH 49/57] perf c2c report: Limit the cachelines table entries Date: Thu, 22 Sep 2016 17:37:17 +0200 Message-Id: <1474558645-19956-50-git-send-email-jolsa@kernel.org> In-Reply-To: <1474558645-19956-1-git-send-email-jolsa@kernel.org> References: <1474558645-19956-1-git-send-email-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 22 Sep 2016 15:39:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a limit for entries number of the cachelines table entries. By default now it's the 0.0005% minimum of remote HITMs. Also display only cachelines with remote hitm or store data. Link: http://lkml.kernel.org/n/tip-inykbom2f19difvsu1e18avr@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-c2c.c | 36 ++++++++++++++++++++++++++++++++++-- tools/perf/util/hist.c | 1 + tools/perf/util/hist.h | 1 + 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 31e311959480..ff89c0b86c44 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1639,11 +1639,42 @@ static int c2c_hists__reinit(struct c2c_hists *c2c_hists, return hpp_list__parse(&c2c_hists->list, output, sort); } -static int filter_cb(struct hist_entry *he __maybe_unused) +#define DISPLAY_LINE_LIMIT 0.0005 + +static bool he__display(struct hist_entry *he, struct c2c_stats *stats) +{ + struct c2c_hist_entry *c2c_he; + double ld_dist; + + c2c_he = container_of(he, struct c2c_hist_entry, he); + + if (stats->rmt_hitm) { + ld_dist = ((double)c2c_he->stats.rmt_hitm / stats->rmt_hitm); + if (ld_dist < DISPLAY_LINE_LIMIT) + he->filtered = HIST_FILTER__C2C; + } else { + he->filtered = HIST_FILTER__C2C; + } + + return he->filtered == 0; +} + +static inline int valid_hitm_or_store(struct hist_entry *he) +{ + struct c2c_hist_entry *c2c_he; + + c2c_he = container_of(he, struct c2c_hist_entry, he); + return c2c_he->stats.rmt_hitm || c2c_he->stats.store; +} + +static int filter_cb(struct hist_entry *he) { if (c2c.show_src && !he->srcline) he->srcline = hist_entry__get_srcline(he); + if (!valid_hitm_or_store(he)) + he->filtered = HIST_FILTER__C2C; + return 0; } @@ -1651,11 +1682,12 @@ static int resort_cl_cb(struct hist_entry *he) { struct c2c_hist_entry *c2c_he; struct c2c_hists *c2c_hists; + bool display = he__display(he, &c2c.hitm_stats); c2c_he = container_of(he, struct c2c_hist_entry, he); c2c_hists = c2c_he->hists; - if (c2c_hists) { + if (display && c2c_hists) { c2c_hists__reinit(c2c_hists, "percent_rmt_hitm," "percent_lcl_hitm," diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index b02992efb513..e1be4132054d 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1195,6 +1195,7 @@ static void hist_entry__check_and_remove_filter(struct hist_entry *he, case HIST_FILTER__GUEST: case HIST_FILTER__HOST: case HIST_FILTER__SOCKET: + case HIST_FILTER__C2C: default: return; } diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 9928fed8bc59..d4b6514eeef5 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -22,6 +22,7 @@ enum hist_filter { HIST_FILTER__GUEST, HIST_FILTER__HOST, HIST_FILTER__SOCKET, + HIST_FILTER__C2C, }; enum hist_column { -- 2.7.4