Skip to content

Commit 9639882

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
perf: Ignore non-sampling overflows
Some arch implementations call perf_event_overflow() by 'accident', ignore this. Reported-by: Francis Moreau <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5d508e8 commit 9639882

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/perf_event.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,6 +4240,13 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,
42404240
struct hw_perf_event *hwc = &event->hw;
42414241
int ret = 0;
42424242

4243+
/*
4244+
* Non-sampling counters might still use the PMI to fold short
4245+
* hardware counters, ignore those.
4246+
*/
4247+
if (unlikely(!is_sampling_event(event)))
4248+
return 0;
4249+
42434250
if (!throttle) {
42444251
hwc->interrupts++;
42454252
} else {

0 commit comments

Comments
 (0)