perf: Ignore non-sampling overflows
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 24 Nov 2010 17:55:29 +0000 (18:55 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 26 Nov 2010 14:14:55 +0000 (15:14 +0100)
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>
kernel/perf_event.c

index 98c5549c8e2953e8367110a3dfeb8543270ef205..af1e63f249f38ae822643c945e5cf09f8396d6a6 100644 (file)
@@ -4240,6 +4240,13 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,
        struct hw_perf_event *hwc = &event->hw;
        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) {
                hwc->interrupts++;
        } else {