summaryrefslogtreecommitdiff
path: root/kernel/events
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2022-09-21 15:00:31 -0700
committerPeter Zijlstra <peterz@infradead.org>2022-09-27 22:50:24 +0200
commit7b084630153152239d84990ac4540c2dd360186f (patch)
tree1a4f811f91b4843ca55bd2c5c5af57a4aa668430 /kernel/events
parentdca6344d7a77dd0501a73745f4a9fb1ee2bc9d7c (diff)
perf: Use sample_flags for addr
Use the new sample_flags to indicate whether the addr field is filled by the PMU driver. As most PMU drivers pass 0, it can set the flag only if it has a non-zero value. And use 0 in perf_sample_output() if it's not filled already. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20220921220032.2858517-1-namhyung@kernel.org
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index c07e9a3ea94c..a91f74db9fe9 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7414,6 +7414,11 @@ void perf_prepare_sample(struct perf_event_header *header,
if (filtered_sample_type & PERF_SAMPLE_TRANSACTION)
data->txn = 0;
+ if (sample_type & (PERF_SAMPLE_ADDR | PERF_SAMPLE_PHYS_ADDR | PERF_SAMPLE_DATA_PAGE_SIZE)) {
+ if (filtered_sample_type & PERF_SAMPLE_ADDR)
+ data->addr = 0;
+ }
+
if (sample_type & PERF_SAMPLE_REGS_INTR) {
/* regs dump ABI info */
int size = sizeof(u64);