linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Linux Weekly News <lwn@lwn.net>,
	Jiri Olsa <jolsa@kernel.org>, Andi Kleen <andi@firstfloor.org>,
	David Ahern <dsahern@gmail.com>, Don Zickus <dzickus@redhat.com>,
	Joe Mario <jmario@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 42/52] perf c2c report: Limit the cachelines table entries
Date: Thu, 20 Oct 2016 12:04:26 -0300	[thread overview]
Message-ID: <1476975876-2522-43-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1476975876-2522-1-git-send-email-acme@kernel.org>

From: Jiri Olsa <jolsa@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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-inykbom2f19difvsu1e18avr@git.kernel.org
[ Disabled for now ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-c2c.c | 37 ++++++++++++++++++++++++++++++++++++-
 tools/perf/util/hist.c   |  1 +
 tools/perf/util/hist.h   |  1 +
 3 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index d51a6c3515cb..0bae8c965554 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -1642,11 +1642,45 @@ static int c2c_hists__reinit(struct c2c_hists *c2c_hists,
 	return hpp_list__parse(&c2c_hists->list, output, sort);
 }
 
+#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;
+
+	/* XXX Disabled for now, till we get a command line switch to control this */
+	return true;
+
+	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;
 }
 
@@ -1654,11 +1688,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

  parent reply	other threads:[~2016-10-20 15:11 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 15:03 [GIT PULL 00/52] New Tool: perf c2c Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 01/52] perf c2c: Introduce c2c_decode_stats function Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 02/52] perf c2c: Introduce c2c_add_stats function Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 03/52] perf c2c: Add c2c command Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 04/52] perf c2c: Add record subcommand Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 05/52] perf c2c: Add report subcommand Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 06/52] perf c2c report: Add dimension support Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 07/52] perf c2c report: Add sort_entry " Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 08/52] perf c2c report: Fallback to standard dimensions Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 09/52] perf c2c report: Add sample processing Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 10/52] perf c2c report: Add cacheline hists processing Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 11/52] perf c2c report: Decode c2c_stats for hist entries Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 12/52] perf c2c report: Add header macros Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 13/52] perf c2c report: Add 'dcacheline' dimension key Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 14/52] perf c2c report: Add 'offset' " Arnaldo Carvalho de Melo
2016-10-20 15:03 ` [PATCH 15/52] perf c2c report: Add 'iaddr' " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 16/52] perf c2c report: Add hitm related dimension keys Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 17/52] perf c2c report: Add stores " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 18/52] perf c2c report: Add loads " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 19/52] perf c2c report: Add llc and remote " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 20/52] perf c2c report: Add llc load miss dimension key Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 21/52] perf c2c report: Add total record sort key Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 22/52] perf c2c report: Add total loads " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 23/52] perf c2c report: Add hitm percent " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 24/52] perf c2c report: Add hitm/store percent related sort keys Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 25/52] perf c2c report: Add dram " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 26/52] perf c2c report: Add 'pid' sort key Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 27/52] perf c2c report: Add 'tid' " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 28/52] perf c2c report: Add 'symbol' and 'dso' sort keys Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 29/52] perf c2c report: Add 'node' sort key Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 30/52] perf c2c report: Add stats related sort keys Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 31/52] perf c2c report: Add 'cpucnt' sort key Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 32/52] perf c2c report: Add src line " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 33/52] perf c2c report: Setup number of header lines for hists Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 34/52] perf c2c report: Set final resort fields Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 35/52] perf c2c report: Add stdio output support Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 36/52] perf c2c report: Add main TUI browser Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 37/52] perf c2c report: Add TUI cacheline browser Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 38/52] perf c2c report: Add global stats stdio output Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 39/52] perf c2c report: Add shared cachelines " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 40/52] perf c2c report: Add c2c related " Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 41/52] perf c2c report: Allow to report callchains Arnaldo Carvalho de Melo
2016-10-20 15:04 ` Arnaldo Carvalho de Melo [this message]
2016-10-20 15:04 ` [PATCH 43/52] perf c2c report: Add support to choose local HITMs Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 44/52] perf c2c report: Allow to set cacheline sort fields Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 45/52] perf c2c report: Recalc width of global sort entries Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 46/52] perf c2c report: Add cacheline index entry Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 47/52] perf c2c report: Add support to manage symbol name length Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 48/52] perf c2c report: Iterate node display in browser Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 49/52] perf c2c report: Add help windows Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 50/52] perf c2c: Add man page and credits Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 51/52] perf c2c report: Add --no-source option Arnaldo Carvalho de Melo
2016-10-20 15:04 ` [PATCH 52/52] perf c2c report: Add --show-all option Arnaldo Carvalho de Melo
2016-10-20 23:02 ` [GIT PULL 00/52] New Tool: perf c2c Kim Phillips
2016-10-21  0:17   ` [PATCH] perf c2c report: Properly check data presence in rb_tree loop Jiri Olsa
2016-10-21 19:23     ` Kim Phillips
2016-10-22  8:49     ` [tip:perf/core] perf c2c report: Add main TUI browser tip-bot for Jiri Olsa
2016-10-21  0:21   ` [GIT PULL 00/52] New Tool: perf c2c Jiri Olsa
2016-10-22  8:28 ` Ingo Molnar
2016-10-23 11:05   ` Jiri Olsa
2016-10-23 23:47     ` Andi Kleen
2016-10-24  6:32       ` Jiri Olsa
2016-10-24  9:23     ` Ingo Molnar
2016-10-24  9:42       ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476975876-2522-43-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=jmario@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lwn@lwn.net \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).