perf, x86: Fix double enable calls
[linux-2.6.git] / arch / x86 / kernel / cpu / perf_event.c
index 045cc0b..1d665a0 100644 (file)
@@ -835,6 +835,10 @@ void hw_perf_enable(void)
                        event = cpuc->event_list[i];
                        hwc = &event->hw;
 
+                       if (i < n_running &&
+                           match_prev_assignment(hwc, cpuc, i))
+                               continue;
+
                        if (hwc->idx == -1)
                                x86_assign_hw_event(event, cpuc, i);