Re: [RFC] perf, x86: Segregate PMU workaraunds intox86_pmu_quirk_ops structure

From: Peter Zijlstra
Date: Mon May 31 2010 - 12:34:35 EST



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?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/