summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-11-21 15:57:44 +0100
committerPeter Zijlstra <peterz@infradead.org>2022-11-24 10:12:23 +0100
commitaf169b7759a9b9369b5106cd07a25c57ce60119e (patch)
treed1b7a94c16b74b8f9c83264ee1aa54d2e90c37c7 /kernel
parenteb7081409f94a9a8608593d0fb63a1aa3d6f95d8 (diff)
perf: Fixup SIGTRAP and sample_flags interaction
The perf_event_attr::sigtrap functionality relies on data->addr being set. However commit 7b0846301531 ("perf: Use sample_flags for addr") changed this to only initialize data->addr when not 0. Fixes: 7b0846301531 ("perf: Use sample_flags for addr") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/Y3426b4OimE%2FI5po%40hirez.programming.kicks-ass.net
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 884871427a94..f2bb27e5c316 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9328,7 +9328,10 @@ static int __perf_event_overflow(struct perf_event *event,
*/
WARN_ON_ONCE(event->pending_sigtrap != pending_id);
}
- event->pending_addr = data->addr;
+
+ event->pending_addr = 0;
+ if (data->sample_flags & PERF_SAMPLE_ADDR)
+ event->pending_addr = data->addr;
irq_work_queue(&event->pending_irq);
}