diff options
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.h | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 682ef00727e7..cd6115867fb8 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -784,6 +784,9 @@ int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign) | |||
784 | 784 | ||
785 | bitmap_zero(used_mask, X86_PMC_IDX_MAX); | 785 | bitmap_zero(used_mask, X86_PMC_IDX_MAX); |
786 | 786 | ||
787 | if (x86_pmu.start_scheduling) | ||
788 | x86_pmu.start_scheduling(cpuc); | ||
789 | |||
787 | for (i = 0, wmin = X86_PMC_IDX_MAX, wmax = 0; i < n; i++) { | 790 | for (i = 0, wmin = X86_PMC_IDX_MAX, wmax = 0; i < n; i++) { |
788 | hwc = &cpuc->event_list[i]->hw; | 791 | hwc = &cpuc->event_list[i]->hw; |
789 | c = x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]); | 792 | c = x86_pmu.get_event_constraints(cpuc, cpuc->event_list[i]); |
@@ -830,6 +833,8 @@ int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign) | |||
830 | for (i = 0; i < n; i++) { | 833 | for (i = 0; i < n; i++) { |
831 | e = cpuc->event_list[i]; | 834 | e = cpuc->event_list[i]; |
832 | e->hw.flags |= PERF_X86_EVENT_COMMITTED; | 835 | e->hw.flags |= PERF_X86_EVENT_COMMITTED; |
836 | if (x86_pmu.commit_scheduling) | ||
837 | x86_pmu.commit_scheduling(cpuc, e, assign[i]); | ||
833 | } | 838 | } |
834 | } | 839 | } |
835 | /* | 840 | /* |
@@ -850,6 +855,10 @@ int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign) | |||
850 | x86_pmu.put_event_constraints(cpuc, e); | 855 | x86_pmu.put_event_constraints(cpuc, e); |
851 | } | 856 | } |
852 | } | 857 | } |
858 | |||
859 | if (x86_pmu.stop_scheduling) | ||
860 | x86_pmu.stop_scheduling(cpuc); | ||
861 | |||
853 | return num ? -EINVAL : 0; | 862 | return num ? -EINVAL : 0; |
854 | } | 863 | } |
855 | 864 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index 55b915511e53..ea27e63fc945 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
@@ -460,6 +460,15 @@ struct x86_pmu { | |||
460 | 460 | ||
461 | void (*put_event_constraints)(struct cpu_hw_events *cpuc, | 461 | void (*put_event_constraints)(struct cpu_hw_events *cpuc, |
462 | struct perf_event *event); | 462 | struct perf_event *event); |
463 | |||
464 | void (*commit_scheduling)(struct cpu_hw_events *cpuc, | ||
465 | struct perf_event *event, | ||
466 | int cntr); | ||
467 | |||
468 | void (*start_scheduling)(struct cpu_hw_events *cpuc); | ||
469 | |||
470 | void (*stop_scheduling)(struct cpu_hw_events *cpuc); | ||
471 | |||
463 | struct event_constraint *event_constraints; | 472 | struct event_constraint *event_constraints; |
464 | struct x86_pmu_quirk *quirks; | 473 | struct x86_pmu_quirk *quirks; |
465 | int perfctr_second_write; | 474 | int perfctr_second_write; |