[tip: perf/urgent] perf/x86/intel: Update arw_latency_data() mem-op direction handling

From: tip-bot2 for Dapeng Mi

Date: Tue Sep 22 2026 - 05:48:13 EST


The following commit has been merged into the perf/urgent branch of tip:

Commit-ID: 335b0642812ee0f2b7798b634ce507b8b7c9fe0c
Gitweb: https://git.kernel.org/tip/335b0642812ee0f2b7798b634ce507b8b7c9fe0c
Author: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
AuthorDate: Thu, 17 Sep 2026 09:52:26 +08:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Tue, 22 Sep 2026 11:19:35 +02:00

perf/x86/intel: Update arw_latency_data() mem-op direction handling

Align arw_latency_data() with other *_latency_data() helpers by
explicitly decoding LOAD/STORE event flags when setting the sampled
memory operation direction.

This keeps the latency data path behavior consistent across platforms
and avoids relying on implicit direction inference.

Signed-off-by: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Link: https://patch.msgid.link/20260917015234.981153-5-dapeng1.mi@xxxxxxxxxxxxxxx
---
arch/x86/events/intel/ds.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index ea5b331..c0004b0 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -538,7 +538,11 @@ static u64 arw_latency_data(struct perf_event *event, u64 status)
val |= P(BLK, NA);

src.val = val;
- if (event->hw.flags & PERF_X86_EVENT_PEBS_ST_HSW)
+ if (event->hw.flags &
+ (PERF_X86_EVENT_PEBS_LDLAT | PERF_X86_EVENT_PEBS_LD_HSW))
+ src.mem_op = P(OP, LOAD);
+ if (event->hw.flags &
+ (PERF_X86_EVENT_PEBS_STLAT | PERF_X86_EVENT_PEBS_ST_HSW))
src.mem_op = P(OP, STORE);

return src.val;