Re: [PATCH 0/8] perf/x86: Rework msr probe interface

From: Jiri Olsa
Date: Tue May 28 2019 - 06:25:53 EST


On Tue, May 28, 2019 at 12:01:47PM +0200, Peter Zijlstra wrote:
> On Mon, May 27, 2019 at 11:51:21PM +0200, Jiri Olsa wrote:
> > hi,
> > following up on [1], [2] and [3], this patchset adds update
> > attribute groups to pmu, factors out the MSR probe code and
> > use it in msr,cstate* and rapl PMUs.
> >
> > The functionality stays the same with one exception:
> > the event is not exported if the rdmsr return zero
> > on event's msr.
>
> That seems a wee bit dangerous, are we sure none of these counters are 0
> by 'accident' when we probe them? I'm thinking esp. things like the Cn
> residency stuff could be 0 simply because we've not been into that state
> yet.

ah right, I can disable that check for cstate pmu
and perhaps for msr pmu as well

It's aiming for rapl counters which could return 0
for unsupported counters, agreed by Kan before:

https://lore.kernel.org/lkml/5fcaf3ae-00d3-f635-74bd-8b81a089133f@xxxxxxxxxxxxxxx/

jirka

>
> Other than that, this looks good. Kan?