Skip to content

Commit 4173cc0

Browse files
Ravi Bangoriaacmel
authored andcommitted
perf mem/c2c: Set PERF_SAMPLE_WEIGHT for LOAD_STORE events
Currently perf sets PERF_SAMPLE_WEIGHT flag only for mem load events. Set it for combined load-store event as well which will enable recording of load latency by default on arch that does not support independent mem load event. Also document missing -W in perf-record man page. Signed-off-by: Ravi Bangoria <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ali Saidi <[email protected]> Cc: Ananth Narayan <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Joe Mario <[email protected]> Cc: Kan Liang <[email protected]> Cc: Kim Phillips <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Sandipan Das <[email protected]> Cc: Santosh Shukla <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 923396f commit 4173cc0

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

tools/perf/Documentation/perf-record.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ is enabled for all the sampling events. The sampled branch type is the same for
411411
The various filters must be specified as a comma separated list: --branch-filter any_ret,u,k
412412
Note that this feature may not be available on all processors.
413413

414+
-W::
414415
--weight::
415416
Enable weightened sampling. An additional weight is recorded per sample and can be
416417
displayed with the weight and local_weight sort keys. This currently works for TSX

tools/perf/builtin-c2c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,6 +3281,7 @@ static int perf_c2c__record(int argc, const char **argv)
32813281
*/
32823282
if (e->tag) {
32833283
e->record = true;
3284+
rec_argv[i++] = "-W";
32843285
} else {
32853286
e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD);
32863287
e->record = true;

tools/perf/builtin-mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
122122
(mem->operation & MEM_OPERATION_LOAD) &&
123123
(mem->operation & MEM_OPERATION_STORE)) {
124124
e->record = true;
125+
rec_argv[i++] = "-W";
125126
} else {
126127
if (mem->operation & MEM_OPERATION_LOAD) {
127128
e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD);

0 commit comments

Comments
 (0)