aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/perf_event.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index c6bde7d7afdc..5fb490c6ee5c 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -811,7 +811,6 @@ void hw_perf_enable(void)
811 * step2: reprogram moved events into new counters 811 * step2: reprogram moved events into new counters
812 */ 812 */
813 for (i = 0; i < n_running; i++) { 813 for (i = 0; i < n_running; i++) {
814
815 event = cpuc->event_list[i]; 814 event = cpuc->event_list[i];
816 hwc = &event->hw; 815 hwc = &event->hw;
817 816
@@ -826,21 +825,16 @@ void hw_perf_enable(void)
826 continue; 825 continue;
827 826
828 x86_pmu_stop(event); 827 x86_pmu_stop(event);
829
830 hwc->idx = -1;
831 } 828 }
832 829
833 for (i = 0; i < cpuc->n_events; i++) { 830 for (i = 0; i < cpuc->n_events; i++) {
834
835 event = cpuc->event_list[i]; 831 event = cpuc->event_list[i];
836 hwc = &event->hw; 832 hwc = &event->hw;
837 833
838 if (i < n_running && 834 if (!match_prev_assignment(hwc, cpuc, i))
839 match_prev_assignment(hwc, cpuc, i))
840 continue;
841
842 if (hwc->idx == -1)
843 x86_assign_hw_event(event, cpuc, i); 835 x86_assign_hw_event(event, cpuc, i);
836 else if (i < n_running)
837 continue;
844 838
845 x86_pmu_start(event); 839 x86_pmu_start(event);
846 } 840 }