diff options
Diffstat (limited to 'arch/x86/events/intel/ds.c')
-rw-r--r-- | arch/x86/events/intel/ds.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index c6d23ffe422d..a322fed5f8ed 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c | |||
@@ -606,12 +606,6 @@ static inline void intel_pmu_drain_pebs_buffer(void) | |||
606 | x86_pmu.drain_pebs(®s); | 606 | x86_pmu.drain_pebs(®s); |
607 | } | 607 | } |
608 | 608 | ||
609 | void intel_pmu_pebs_sched_task(struct perf_event_context *ctx, bool sched_in) | ||
610 | { | ||
611 | if (!sched_in) | ||
612 | intel_pmu_drain_pebs_buffer(); | ||
613 | } | ||
614 | |||
615 | /* | 609 | /* |
616 | * PEBS | 610 | * PEBS |
617 | */ | 611 | */ |
@@ -651,6 +645,12 @@ struct event_constraint intel_glm_pebs_event_constraints[] = { | |||
651 | EVENT_CONSTRAINT_END | 645 | EVENT_CONSTRAINT_END |
652 | }; | 646 | }; |
653 | 647 | ||
648 | struct event_constraint intel_glp_pebs_event_constraints[] = { | ||
649 | /* Allow all events as PEBS with no flags */ | ||
650 | INTEL_ALL_EVENT_CONSTRAINT(0, 0xf), | ||
651 | EVENT_CONSTRAINT_END | ||
652 | }; | ||
653 | |||
654 | struct event_constraint intel_nehalem_pebs_event_constraints[] = { | 654 | struct event_constraint intel_nehalem_pebs_event_constraints[] = { |
655 | INTEL_PLD_CONSTRAINT(0x100b, 0xf), /* MEM_INST_RETIRED.* */ | 655 | INTEL_PLD_CONSTRAINT(0x100b, 0xf), /* MEM_INST_RETIRED.* */ |
656 | INTEL_FLAGS_EVENT_CONSTRAINT(0x0f, 0xf), /* MEM_UNCORE_RETIRED.* */ | 656 | INTEL_FLAGS_EVENT_CONSTRAINT(0x0f, 0xf), /* MEM_UNCORE_RETIRED.* */ |
@@ -816,6 +816,14 @@ static inline bool pebs_needs_sched_cb(struct cpu_hw_events *cpuc) | |||
816 | return cpuc->n_pebs && (cpuc->n_pebs == cpuc->n_large_pebs); | 816 | return cpuc->n_pebs && (cpuc->n_pebs == cpuc->n_large_pebs); |
817 | } | 817 | } |
818 | 818 | ||
819 | void intel_pmu_pebs_sched_task(struct perf_event_context *ctx, bool sched_in) | ||
820 | { | ||
821 | struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); | ||
822 | |||
823 | if (!sched_in && pebs_needs_sched_cb(cpuc)) | ||
824 | intel_pmu_drain_pebs_buffer(); | ||
825 | } | ||
826 | |||
819 | static inline void pebs_update_threshold(struct cpu_hw_events *cpuc) | 827 | static inline void pebs_update_threshold(struct cpu_hw_events *cpuc) |
820 | { | 828 | { |
821 | struct debug_store *ds = cpuc->ds; | 829 | struct debug_store *ds = cpuc->ds; |
@@ -889,6 +897,8 @@ void intel_pmu_pebs_enable(struct perf_event *event) | |||
889 | if (hwc->flags & PERF_X86_EVENT_AUTO_RELOAD) { | 897 | if (hwc->flags & PERF_X86_EVENT_AUTO_RELOAD) { |
890 | ds->pebs_event_reset[hwc->idx] = | 898 | ds->pebs_event_reset[hwc->idx] = |
891 | (u64)(-hwc->sample_period) & x86_pmu.cntval_mask; | 899 | (u64)(-hwc->sample_period) & x86_pmu.cntval_mask; |
900 | } else { | ||
901 | ds->pebs_event_reset[hwc->idx] = 0; | ||
892 | } | 902 | } |
893 | } | 903 | } |
894 | 904 | ||