Skip to content

Commit cb2bb85

Browse files
Ravi BangoriaPeter Zijlstra
authored andcommitted
perf/x86/amd: Support PERF_SAMPLE_ADDR
IBS_DC_LINADDR provides the linear data address for the tagged load/ store operation. Populate perf sample address using it. Signed-off-by: Ravi Bangoria <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 6b2ae49 commit cb2bb85

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/events/amd/ibs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,11 @@ static void perf_ibs_parse_ld_st_data(__u64 sample_type,
984984
}
985985
data->sample_flags |= PERF_SAMPLE_WEIGHT_TYPE;
986986
}
987+
988+
if (sample_type & PERF_SAMPLE_ADDR && op_data3.dc_lin_addr_valid) {
989+
data->addr = ibs_data->regs[ibs_op_msr_idx(MSR_AMD64_IBSDCLINAD)];
990+
data->sample_flags |= PERF_SAMPLE_ADDR;
991+
}
987992
}
988993

989994
static int perf_ibs_get_offset_max(struct perf_ibs *perf_ibs, u64 sample_type,
@@ -992,7 +997,8 @@ static int perf_ibs_get_offset_max(struct perf_ibs *perf_ibs, u64 sample_type,
992997
if (sample_type & PERF_SAMPLE_RAW ||
993998
(perf_ibs == &perf_ibs_op &&
994999
(sample_type & PERF_SAMPLE_DATA_SRC ||
995-
sample_type & PERF_SAMPLE_WEIGHT_TYPE)))
1000+
sample_type & PERF_SAMPLE_WEIGHT_TYPE ||
1001+
sample_type & PERF_SAMPLE_ADDR)))
9961002
return perf_ibs->offset_max;
9971003
else if (check_rip)
9981004
return 3;

0 commit comments

Comments
 (0)