summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-c2c.c
diff options
context:
space:
mode:
authorJiri Olsa2016-07-10 15:47:40 +0200
committerArnaldo Carvalho de Melo2016-10-19 18:18:31 +0200
commit89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd (patch)
tree35f0c905f67e932b2e3bb4be34ad96430834e175 /tools/perf/builtin-c2c.c
parentperf c2c report: Add 'cpucnt' sort key (diff)
downloadkernel-qcow2-linux-89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd.tar.gz
kernel-qcow2-linux-89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd.tar.xz
kernel-qcow2-linux-89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd.zip
perf c2c report: Add src line sort key
It is to be displayed in the single cacheline output: cl_srcline It displays source line related to the code address that accessed cacheline. It's a wrapper to global srcline sort entry. 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-cmnzgm37mjz56ozsg4mnbgxq@git.kernel.org [ Remove __maybe_unused from now used 'he' parameter in filter_cb() ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-c2c.c')
-rw-r--r--tools/perf/builtin-c2c.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 2a1e883580a1..0f898d3ff84c 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -50,6 +50,8 @@ struct perf_c2c {
int cpus_cnt;
int *cpu2node;
int node_info;
+
+ bool show_src;
};
static struct perf_c2c c2c;
@@ -1363,6 +1365,11 @@ static struct c2c_dimension dim_cpucnt = {
.width = 8,
};
+static struct c2c_dimension dim_srcline = {
+ .name = "cl_srcline",
+ .se = &sort_srcline,
+};
+
static struct c2c_dimension *dimensions[] = {
&dim_dcacheline,
&dim_offset,
@@ -1401,6 +1408,7 @@ static struct c2c_dimension *dimensions[] = {
&dim_mean_lcl,
&dim_mean_load,
&dim_cpucnt,
+ &dim_srcline,
NULL,
};
@@ -1606,8 +1614,11 @@ 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)
+static int filter_cb(struct hist_entry *he)
{
+ if (c2c.show_src && !he->srcline)
+ he->srcline = hist_entry__get_srcline(he);
+
return 0;
}