Pārlūkot izejas kodu

perf: Ignore non-sampling overflows

Some arch implementations call perf_event_overflow() by 'accident',
ignore this.

Reported-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Peter Zijlstra 14 gadi atpakaļ
vecāks
revīzija
963988262c
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      kernel/perf_event.c

+ 7 - 0
kernel/perf_event.c

@@ -4240,6 +4240,13 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,
 	struct hw_perf_event *hwc = &event->hw;
 	struct hw_perf_event *hwc = &event->hw;
 	int ret = 0;
 	int ret = 0;
 
 
+	/*
+	 * Non-sampling counters might still use the PMI to fold short
+	 * hardware counters, ignore those.
+	 */
+	if (unlikely(!is_sampling_event(event)))
+		return 0;
+
 	if (!throttle) {
 	if (!throttle) {
 		hwc->interrupts++;
 		hwc->interrupts++;
 	} else {
 	} else {