Skip to content

Commit d4bdb0b

Browse files
Stephane EranianPeter Zijlstra
authored andcommitted
perf/x86/intel/ds: Fix precise store latency handling
With the existing code in store_latency_data(), the memory operation (mem_op) returned to the user is always OP_LOAD where in fact, it should be OP_STORE. This comes from the fact that the function is simply grabbing the information from a data source map which covers only load accesses. Intel 12th gen CPU offers precise store sampling that captures both the data source and latency. Therefore it can use the data source mapping table but must override the memory operation to reflect stores instead of loads. Fixes: 61b985e ("perf/x86/intel: Add perf core PMU support for Sapphire Rapids") Signed-off-by: Stephane Eranian <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 7d35988 commit d4bdb0b

File tree

1 file changed

+9
-1
lines changed
  • arch/x86/events/intel

1 file changed

+9
-1
lines changed

arch/x86/events/intel/ds.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ static u64 load_latency_data(struct perf_event *event, u64 status)
291291
static u64 store_latency_data(struct perf_event *event, u64 status)
292292
{
293293
union intel_x86_pebs_dse dse;
294+
union perf_mem_data_src src;
294295
u64 val;
295296

296297
dse.val = status;
@@ -304,7 +305,14 @@ static u64 store_latency_data(struct perf_event *event, u64 status)
304305

305306
val |= P(BLK, NA);
306307

307-
return val;
308+
/*
309+
* the pebs_data_source table is only for loads
310+
* so override the mem_op to say STORE instead
311+
*/
312+
src.val = val;
313+
src.mem_op = P(OP,STORE);
314+
315+
return src.val;
308316
}
309317

310318
struct pebs_record_core {

0 commit comments

Comments
 (0)