|
@@ -1094,13 +1094,16 @@ int x86_perf_event_set_period(struct perf_event *event)
|
|
|
|
|
|
per_cpu(pmc_prev_left[idx], smp_processor_id()) = left;
|
|
|
|
|
|
- /*
|
|
|
- * The hw event starts counting from this event offset,
|
|
|
- * mark it to be able to extra future deltas:
|
|
|
- */
|
|
|
- local64_set(&hwc->prev_count, (u64)-left);
|
|
|
+ if (!(hwc->flags & PERF_X86_EVENT_AUTO_RELOAD) ||
|
|
|
+ local64_read(&hwc->prev_count) != (u64)-left) {
|
|
|
+ /*
|
|
|
+ * The hw event starts counting from this event offset,
|
|
|
+ * mark it to be able to extra future deltas:
|
|
|
+ */
|
|
|
+ local64_set(&hwc->prev_count, (u64)-left);
|
|
|
|
|
|
- wrmsrl(hwc->event_base, (u64)(-left) & x86_pmu.cntval_mask);
|
|
|
+ wrmsrl(hwc->event_base, (u64)(-left) & x86_pmu.cntval_mask);
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
* Due to erratum on certan cpu we need
|