Messages in this thread | | | Subject | Re: [RFC] perf, x86: Segregate PMU workaraunds into x86_pmu_quirk_ops structure | From | Peter Zijlstra <> | Date | Sat, 29 May 2010 20:33:10 +0200 |
| |
On Sat, 2010-05-29 at 22:24 +0400, Cyrill Gorcunov wrote: > @@ -924,7 +930,11 @@ x86_perf_event_set_period(struct perf_ev > */ > atomic64_set(&hwc->prev_count, (u64)-left); > > - wrmsrl(hwc->event_base + idx, > + if (x86_pmu.quirks.perfctr_write) > + x86_pmu.quirks.perfctr_write(hwc->event_base + idx, > + (u64)(-left) & x86_pmu.cntval_mask); > + else > + wrmsrl(hwc->event_base + idx, > (u64)(-left) & x86_pmu.cntval_mask);
This bit is rather ugly,.. not quite sure how to clean it up though. Anybody got a bright idea?
| |