Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1488996
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jiri Olsa <jolsa@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 29/57] perf c2c report: Add total loads sort key |
| Date | Thu, 22 Sep 2016 17:40:02 +0200 |
| Message-ID | <skegq-8a2-29@gated-at.bofh.it> (permalink) |
| References | <skegp-8a2-3@gated-at.bofh.it> |
| X-Original-To | Arnaldo Carvalho de Melo <acme@kernel.org> |
| X-Scanned-By | MIMEDefang 2.68 on 10.5.11.26 |
| X-Greylist | Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 22 Sep 2016 15:38:34 +0000 (UTC) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 102 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | lkml <linux-kernel@vger.kernel.org>, Don Zickus <dzickus@redhat.com>, Joe Mario <jmario@redhat.com>, Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <a.p.zijlstra@chello.nl>, Namhyung Kim <namhyung@kernel.org>, David Ahern <dsahern@gmail.com>, Andi Kleen <andi@firstfloor.org> |
| X-Original-Date | Thu, 22 Sep 2016 17:36:57 +0200 |
| X-Original-Message-ID | <1474558645-19956-30-git-send-email-jolsa@kernel.org> |
| X-Original-References | <1474558645-19956-1-git-send-email-jolsa@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1488996 |
Show key headers only | View raw
Adding total loads dimension key wrapper.
It is to be displayed in the main cachelines
overall output:
tot_loads
It displays sum of all load accesses for cacheline.
Link: http://lkml.kernel.org/n/tip-czd17qsh5u5z0yc1estz9l2y@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/builtin-c2c.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index d96cad97b4d7..11b3db91fce9 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -511,6 +511,57 @@ tot_recs_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
return tot_recs_left - tot_recs_right;
}
+static uint64_t total_loads(struct c2c_stats *stats)
+{
+ uint64_t lclmiss, ldcnt;
+
+ lclmiss = stats->lcl_dram +
+ stats->rmt_dram +
+ stats->rmt_hitm +
+ stats->rmt_hit;
+
+ ldcnt = lclmiss +
+ stats->ld_fbhit +
+ stats->ld_l1hit +
+ stats->ld_l2hit +
+ stats->ld_llchit +
+ stats->lcl_hitm;
+
+ return ldcnt;
+}
+
+static int
+tot_loads_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
+ struct hist_entry *he)
+{
+ struct c2c_hist_entry *c2c_he;
+ int width = c2c_width(fmt, hpp, he->hists);
+ uint64_t tot_recs;
+
+ c2c_he = container_of(he, struct c2c_hist_entry, he);
+ tot_recs = total_loads(&c2c_he->stats);
+
+ return snprintf(hpp->buf, hpp->size, "%*" PRIu64, width, tot_recs);
+}
+
+static int64_t
+tot_loads_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
+ struct hist_entry *left, struct hist_entry *right)
+{
+ struct c2c_hist_entry *c2c_left;
+ struct c2c_hist_entry *c2c_right;
+ uint64_t tot_recs_left;
+ uint64_t tot_recs_right;
+
+ c2c_left = container_of(left, struct c2c_hist_entry, he);
+ c2c_right = container_of(right, struct c2c_hist_entry, he);
+
+ tot_recs_left = total_loads(&c2c_left->stats);
+ tot_recs_right = total_loads(&c2c_right->stats);
+
+ return tot_recs_left - tot_recs_right;
+}
+
#define HEADER_LOW(__h) \
{ \
.line[1] = { \
@@ -706,6 +757,14 @@ static struct c2c_dimension dim_tot_recs = {
.width = 7,
};
+static struct c2c_dimension dim_tot_loads = {
+ .header = HEADER_BOTH("Total", "Loads"),
+ .name = "tot_loads",
+ .cmp = tot_loads_cmp,
+ .entry = tot_loads_entry,
+ .width = 7,
+};
+
static struct c2c_dimension *dimensions[] = {
&dim_dcacheline,
&dim_offset,
@@ -727,6 +786,7 @@ static struct c2c_dimension *dimensions[] = {
&dim_ld_rmthit,
&dim_ld_llcmiss,
&dim_tot_recs,
+ &dim_tot_loads,
NULL,
};
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 29/57] perf c2c report: Add total loads sort key Jiri Olsa <jolsa@kernel.org> - 2016-09-22 17:40 +0200
csiph-web