[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20210316155103.568872-2-schatzberg.dan@gmail.com>
Date: Tue, 16 Mar 2021 08:51:03 -0700
From: Dan Schatzberg <schatzberg.dan@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
linux-kernel@...r.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM)
Subject: [PATCH 1/1] perf: display raw event for mem report
`perf mem record` can be used to capture memory loads/stores using
PEBS counters. `perf mem report -D` can be used to dump the raw
samples (e.g. each sampled memory access). However, it does not output
the raw event (load vs store).
This patch supplements the output of `perf mem report -D` with the
event name.
Signed-off-by: Dan Schatzberg <schatzberg.dan@...il.com>
---
tools/perf/builtin-mem.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index cdd2b9f643f6..1f4ec350bca3 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -172,6 +172,7 @@ static int
dump_raw_samples(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
+ struct evsel *evsel,
struct machine *machine)
{
struct perf_mem *mem = container_of(tool, struct perf_mem, tool);
@@ -220,6 +221,11 @@ dump_raw_samples(struct perf_tool *tool,
symbol_conf.field_sep);
}
+ if (evsel->name)
+ printf("%s%s", evsel->name, symbol_conf.field_sep);
+ else
+ printf("%s", symbol_conf.field_sep);
+
if (field_sep)
fmt = "%"PRIu64"%s0x%"PRIx64"%s%s:%s\n";
else
@@ -240,10 +246,10 @@ dump_raw_samples(struct perf_tool *tool,
static int process_sample_event(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
- struct evsel *evsel __maybe_unused,
+ struct evsel *evsel,
struct machine *machine)
{
- return dump_raw_samples(tool, event, sample, machine);
+ return dump_raw_samples(tool, event, sample, evsel, machine);
}
static int report_raw_events(struct perf_mem *mem)
@@ -287,7 +293,7 @@ static int report_raw_events(struct perf_mem *mem)
if (mem->data_page_size)
printf("DATA PAGE SIZE, ");
- printf("LOCAL WEIGHT, DSRC, SYMBOL\n");
+ printf("EVENT, LOCAL WEIGHT, DSRC, SYMBOL\n");
ret = perf_session__process_events(session);
--
2.30.2
Powered by blists - more mailing lists