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 52/68] perf c2c report: Add cacheline index entry
Date: Tue, 11 Oct 2016 14:31:47 -0300 [thread overview]
Message-ID: <1476207123-21791-53-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1476207123-21791-1-git-send-email-acme@kernel.org>
From: Jiri Olsa <jolsa@kernel.org>
It's convenient to have an index for each cacheline to help discussions
about results over the phone.
Add new 'Index' and 'Num' fields in main and single cacheline tables.
$ perf c2c report
=================================================
Shared Data Cache Line Table
=================================================
#
# Total Lcl ----- LLC Load Hitm -----
# Index Cacheline records Hitm Total Lcl Rmt ...
# ..... .................. ....... ....... ....... ....... .......
#
0 0xffff880036233b40 1 11.11% 1 1 0
1 0xffff88009ccb2900 1 11.11% 1 1 0
2 0xffff8800b5b3bc40 7 11.11% 1 1 0
...
=================================================
Shared Cache Line Distribution Pareto
=================================================
#
# ----- HITM ----- -- Store Refs -- Data address
# Num Rmt Lcl L1 Hit L1 Miss Offset Pid ...
# ..... ....... ....... ....... ....... .................. .......
#
-------------------------------------------------------------
0 0 1 0 0 0xffff880036233b40
-------------------------------------------------------------
0.00% 100.00% 0.00% 0.00% 0x30 0
-------------------------------------------------------------
1 0 1 0 0 0xffff88009ccb2900
-------------------------------------------------------------
0.00% 100.00% 0.00% 0.00% 0x28 549
...
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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-4dhfagaz57tvrfjbg8nd2h4u@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-c2c.c | 64 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 61 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 473dae1baed8..430360e618b0 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -36,6 +36,7 @@ struct c2c_hist_entry {
struct c2c_stats stats;
unsigned long *cpuset;
struct c2c_stats *node_stats;
+ unsigned int cacheline_idx;
struct compute_stats cstats;
@@ -1088,6 +1089,29 @@ cpucnt_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
return scnprintf(hpp->buf, hpp->size, "%*s", width, buf);
}
+static int
+cl_idx_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
+ struct hist_entry *he)
+{
+ struct c2c_hist_entry *c2c_he;
+ int width = c2c_width(fmt, hpp, he->hists);
+ char buf[10];
+
+ c2c_he = container_of(he, struct c2c_hist_entry, he);
+
+ scnprintf(buf, 10, "%u", c2c_he->cacheline_idx);
+ return scnprintf(hpp->buf, hpp->size, "%*s", width, buf);
+}
+
+static int
+cl_idx_empty_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
+ struct hist_entry *he)
+{
+ int width = c2c_width(fmt, hpp, he->hists);
+
+ return scnprintf(hpp->buf, hpp->size, "%*s", width, "");
+}
+
#define HEADER_LOW(__h) \
{ \
.line[1] = { \
@@ -1433,6 +1457,30 @@ static struct c2c_dimension dim_srcline = {
.se = &sort_srcline,
};
+static struct c2c_dimension dim_dcacheline_idx = {
+ .header = HEADER_LOW("Index"),
+ .name = "cl_idx",
+ .cmp = empty_cmp,
+ .entry = cl_idx_entry,
+ .width = 5,
+};
+
+static struct c2c_dimension dim_dcacheline_num = {
+ .header = HEADER_LOW("Num"),
+ .name = "cl_num",
+ .cmp = empty_cmp,
+ .entry = cl_idx_entry,
+ .width = 5,
+};
+
+static struct c2c_dimension dim_dcacheline_num_empty = {
+ .header = HEADER_LOW("Num"),
+ .name = "cl_num_empty",
+ .cmp = empty_cmp,
+ .entry = cl_idx_empty_entry,
+ .width = 5,
+};
+
static struct c2c_dimension *dimensions[] = {
&dim_dcacheline,
&dim_offset,
@@ -1472,6 +1520,9 @@ static struct c2c_dimension *dimensions[] = {
&dim_mean_load,
&dim_cpucnt,
&dim_srcline,
+ &dim_dcacheline_idx,
+ &dim_dcacheline_num,
+ &dim_dcacheline_num_empty,
NULL,
};
@@ -1761,6 +1812,10 @@ static int resort_cl_cb(struct hist_entry *he)
calc_width(he);
if (display && c2c_hists) {
+ static unsigned int idx;
+
+ c2c_he->cacheline_idx = idx++;
+
c2c_hists__reinit(c2c_hists, c2c.cl_output, c2c.cl_resort);
hists__collapse_resort(&c2c_hists->hists, NULL);
@@ -1948,10 +2003,10 @@ static void print_cacheline(struct c2c_hists *c2c_hists,
fprintf(out, "\n");
}
- fprintf(out, " ------------------------------------------------------\n");
+ fprintf(out, " -------------------------------------------------------------\n");
__hist_entry__snprintf(he_cl, &hpp, hpp_list);
fprintf(out, "%s\n", bf);
- fprintf(out, " ------------------------------------------------------\n");
+ fprintf(out, " -------------------------------------------------------------\n");
hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, true);
}
@@ -1964,6 +2019,7 @@ static void print_pareto(FILE *out)
perf_hpp_list__init(&hpp_list);
ret = hpp_list__parse(&hpp_list,
+ "cl_num,"
"cl_rmt_hitm,"
"cl_lcl_hitm,"
"cl_stores_l1hit,"
@@ -2321,7 +2377,8 @@ static int build_cl_output(char *cl_sort)
}
if (asprintf(&c2c.cl_output,
- "%s%s%s%s%s%s%s%s%s",
+ "%s%s%s%s%s%s%s%s%s%s",
+ c2c.use_stdio ? "cl_num_empty," : "",
"percent_rmt_hitm,"
"percent_lcl_hitm,"
"percent_stores_l1hit,"
@@ -2470,6 +2527,7 @@ static int perf_c2c__report(int argc, const char **argv)
}
c2c_hists__reinit(&c2c.hists,
+ "cl_idx,"
"dcacheline,"
"tot_recs,"
"percent_hitm,"
--
2.7.4
next prev parent reply other threads:[~2016-10-11 17:32 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-11 17:30 [GIT PULL 00/68] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-10-11 17:30 ` [PATCH 01/68] perf list: Add support for listing only json events Arnaldo Carvalho de Melo
2016-10-11 17:30 ` [PATCH 02/68] perf tools: Handle completion of upper case events Arnaldo Carvalho de Melo
2016-10-11 17:30 ` [PATCH 03/68] perf intel-pt/bts: Tidy instruction buffer size usage Arnaldo Carvalho de Melo
2016-10-11 17:30 ` [PATCH 04/68] perf intel-pt/bts: Report instruction bytes and length in sample Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 05/68] perf top: Fix refreshing hierarchy entries on TUI Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 06/68] perf tools: Sync copy of x86's syscall table Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 07/68] perf c2c: Introduce c2c_decode_stats function Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 08/68] perf c2c: Introduce c2c_add_stats function Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 09/68] perf c2c: Add c2c command Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 10/68] perf c2c: Add record subcommand Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 11/68] perf c2c: Add report subcommand Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 12/68] perf c2c report: Add dimension support Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 13/68] perf c2c report: Add sort_entry " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 14/68] perf c2c report: Fallback to standard dimensions Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 15/68] perf c2c report: Add sample processing Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 16/68] perf c2c report: Add cacheline hists processing Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 17/68] perf c2c report: Decode c2c_stats for hist entries Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 18/68] perf c2c report: Add header macros Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 19/68] perf c2c report: Add 'dcacheline' dimension key Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 20/68] perf c2c report: Add 'offset' " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 21/68] perf c2c report: Add 'iaddr' " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 22/68] perf c2c report: Add hitm related dimension keys Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 23/68] perf c2c report: Add stores " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 24/68] perf c2c report: Add loads " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 25/68] perf c2c report: Add llc and remote " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 26/68] perf c2c report: Add llc load miss dimension key Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 27/68] perf c2c report: Add total record sort key Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 28/68] perf c2c report: Add total loads " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 29/68] perf c2c report: Add hitm percent " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 30/68] perf c2c report: Add hitm/store percent related sort keys Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 31/68] perf c2c report: Add dram " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 32/68] perf c2c report: Add 'pid' sort key Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 33/68] perf c2c report: Add 'tid' " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 34/68] perf c2c report: Add 'symbol' and 'dso' sort keys Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 35/68] perf c2c report: Add 'node' sort key Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 36/68] perf c2c report: Add stats related sort keys Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 37/68] perf c2c report: Add 'cpucnt' sort key Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 38/68] perf c2c report: Add src line " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 39/68] perf c2c report: Setup number of header lines for hists Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 40/68] perf c2c report: Set final resort fields Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 41/68] perf c2c report: Add stdio output support Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 42/68] perf c2c report: Add main TUI browser Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 43/68] perf c2c report: Add TUI cacheline browser Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 44/68] perf c2c report: Add global stats stdio output Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 45/68] perf c2c report: Add shared cachelines " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 46/68] perf c2c report: Add c2c related " Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 47/68] perf c2c report: Allow to report callchains Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 48/68] perf c2c report: Limit the cachelines table entries Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 49/68] perf c2c report: Add support to choose local HITMs Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 50/68] perf c2c report: Allow to set cacheline sort fields Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 51/68] perf c2c report: Recalc width of global sort entries Arnaldo Carvalho de Melo
2016-10-11 17:31 ` Arnaldo Carvalho de Melo [this message]
2016-10-11 17:31 ` [PATCH 53/68] perf c2c report: Add support to manage symbol name length Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 54/68] perf c2c report: Iterate node display in browser Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 55/68] perf c2c report: Add help windows Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 56/68] perf c2c: Add man page and credits Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 57/68] tools lib traceevent: Add install_headers target Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 58/68] tools lib traceevent: Add do_install_mkdir Makefile function Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 59/68] tools lib traceevent: Rename LIB_FILE to LIB_TARGET Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 60/68] tools lib traceevent: Add version for traceevent shared object Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 61/68] tools lib: Add for_each_clear_bit macro Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 62/68] perf report: Move captured info to generic header info Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 63/68] perf header: Display missing features Arnaldo Carvalho de Melo
2016-10-11 17:31 ` [PATCH 64/68] perf header: Display feature name on write failure Arnaldo Carvalho de Melo
2016-10-11 17:32 ` [PATCH 65/68] perf header: Set nr_numa_nodes only when we parsed all the data Arnaldo Carvalho de Melo
2016-10-11 17:32 ` [PATCH 66/68] perf c2c report: Add --no-source option Arnaldo Carvalho de Melo
2016-10-11 17:32 ` [PATCH 67/68] perf c2c report: Add --show-all option Arnaldo Carvalho de Melo
2016-10-11 17:32 ` [PATCH 68/68] perf jevents: Handle events including .c and .o Arnaldo Carvalho de Melo
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=1476207123-21791-53-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
Powered by JetHome