Re: [RFC] x86, perf: Add an aperfmperf driver

From: Peter Zijlstra
Date: Wed Apr 29 2015 - 05:13:27 EST


On Tue, Apr 28, 2015 at 03:43:38PM -0700, Andy Lutomirski wrote:
> On Tue, Apr 28, 2015 at 3:29 PM, Brown, Len <len.brown@xxxxxxxxx> wrote:

> >> Thoughts? Would it make sense at all? Did I wire it up right? This is
> >> the only PMU driver I've ever written, and it could have any number of
> >> issues.
> >
> > APERF/MPERF, as with all per-thread MSRs, must be accessed
> > from the local processor. I didn't see where this driver
> > distinguishes the CPU. Also, I assume the intent is to return
> > a snapshot, rather than sampling, yes?
>
> I think that the perf core takes care of that for us, but I'm not entirely sure.

It does indeed. The events are always created/used in either task or cpu
context, and in the case of task context they're context switched along,
which again results in strict per cpu usage.

Since this driver has no state to track nothing else is required.
--
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/