Skip to contentSkip to conversation

perf mem: enable simultaneous sampling of loads/stores

PATCH Superseded Stephane Eranian 2 participants 2 messages Dec 16, 2014 – Dec 17, 2014 perf events

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf mem: enable simultaneous sampling of loads/stores

This patch modifies perf mem to default to smapling loads and stores simultaneously. It could only do one or the other before yet there was not hardware restriction preventing simultaneous collection. With this patch, one run is sufficient to collect both.

It is still possible to smaple only loads or stores by using the -t option:

 $ perf mem -t load rec
 $ perf mem -t load rep
Or
 $ perf mem -t store rec
 $ perf mem -t store rep

The perf report TUI will show one event at a time. The store output will contain a Weight column which will be empty.

In V2, we update the man page and simplify the initialization of the argv vector to cmd_*().

---
 tools/perf/Documentation/perf-mem.txt |   9 +--
 tools/perf/builtin-mem.c              | 123 +++++++++++++++++++++++++++-------
 2 files changed, 105 insertions(+), 27 deletions(-)
tools/perf/Documentation/perf-mem.txt +5 -4
index 1d78a40..43310d8 100644
@@ -12,11 +12,12 @@ SYNOPSIS
 
 DESCRIPTION
 -----------
-"perf mem -t <TYPE> record" runs a command and gathers memory operation data
+"perf mem record" runs a command and gathers memory operation data
 from it, into perf.data. Perf record options are accepted and are passed through.
 
-"perf mem -t <TYPE> report" displays the result. It invokes perf report with the
-right set of options to display a memory access profile.
+"perf mem report" displays the result. It invokes perf report with the
+right set of options to display a memory access profile. By default, loads
+and stores are sampled. Use the -t option to limit to loads or stores.
 
 Note that on Intel systems the memory latency reported is the use-latency,
 not the pure load (or store latency). Use latency includes any pipeline
@@ -29,7 +30,7 @@ OPTIONS
 
 -t::
 --type=::
-	Select the memory operation type: load or store (default: load)
+	Select the memory operation type: load or store (default: load,store)
 
 -D::
 --dump-raw-samples=::
tools/perf/builtin-mem.c +100 -23

167 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Stephane Eranian

This patch modifies perf mem to default to smapling loads

s/smapling/sampling

Quoted 6 lines

and stores simultaneously. It could only do one or the other before yet there was not hardware restriction preventing simultaneous collection. With this patch, one run is sufficient to collect both.

It is still possible to smaple only loads or stores by using the

s/smaple/sample

Thanks,

Ingo