Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1499048
| Path | csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 19/68] perf c2c report: Add 'dcacheline' dimension key |
| Date | Tue, 11 Oct 2016 19:40:02 +0200 |
| Message-ID | <sr9bY-195-33@gated-at.bofh.it> (permalink) |
| References | <sr9bX-195-3@gated-at.bofh.it> |
| X-Original-To | Ingo Molnar <mingo@kernel.org> |
| X-Mailer | git-send-email 2.7.4 |
| X-Srs-Rewrite | SMTP reverse-path rewritten from <acme@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html |
| 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 | 91 |
| Organization | linux.* mail to news gateway |
| X-Original-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> |
| X-Original-Date | Tue, 11 Oct 2016 14:31:14 -0300 |
| X-Original-Message-ID | <1476207123-21791-20-git-send-email-acme@kernel.org> |
| X-Original-References | <1476207123-21791-1-git-send-email-acme@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1499048 |
Show key headers only | View raw
From: Jiri Olsa <jolsa@kernel.org>
It displays cacheline address as hex number.
Using c2c wrapper to standard 'dcacheline' object to defined own header
and simple (just address) cacheline output.
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/r/1474558645-19956-21-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-c2c.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 78addc42c9e5..3a3e67f6e772 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -1,5 +1,6 @@
#include <linux/compiler.h>
#include <linux/kernel.h>
+#include <linux/stringify.h>
#include "util.h"
#include "debug.h"
#include "builtin.h"
@@ -7,6 +8,7 @@
#include "mem-events.h"
#include "session.h"
#include "hist.h"
+#include "sort.h"
#include "tool.h"
#include "data.h"
#include "sort.h"
@@ -273,6 +275,32 @@ static int c2c_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
return scnprintf(hpp->buf, hpp->size, "%*s", width, text);
}
+#define HEX_STR(__s, __v) \
+({ \
+ scnprintf(__s, sizeof(__s), "0x%" PRIx64, __v); \
+ __s; \
+})
+
+static int64_t
+dcacheline_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
+ struct hist_entry *left, struct hist_entry *right)
+{
+ return sort__dcacheline_cmp(left, right);
+}
+
+static int dcacheline_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
+ struct hist_entry *he)
+{
+ uint64_t addr = 0;
+ int width = c2c_width(fmt, hpp, he->hists);
+ char buf[20];
+
+ if (he->mem_info)
+ addr = cl_address(he->mem_info->daddr.addr);
+
+ return scnprintf(hpp->buf, hpp->size, "%*s", width, HEX_STR(buf, addr));
+}
+
#define HEADER_LOW(__h) \
{ \
.line[1] = { \
@@ -308,7 +336,16 @@ static int c2c_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
}, \
}
+static struct c2c_dimension dim_dcacheline = {
+ .header = HEADER_LOW("Cacheline"),
+ .name = "dcacheline",
+ .cmp = dcacheline_cmp,
+ .entry = dcacheline_entry,
+ .width = 18,
+};
+
static struct c2c_dimension *dimensions[] = {
+ &dim_dcacheline,
NULL,
};
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 19/68] perf c2c report: Add 'dcacheline' dimension key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-11 19:40 +0200
csiph-web