Re: [PATCH] perf test x86: address multiplexing in rdpmc test

From: Peter Zijlstra
Date: Sun Mar 22 2020 - 05:12:55 EST


On Sat, Mar 21, 2020 at 10:44:49AM -0700, Ian Rogers wrote:
> On Sat, Mar 21, 2020 at 6:41 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > On Fri, Mar 20, 2020 at 05:14:00PM -0700, Ian Rogers wrote:
> > > Counters may be being used for pinned or other events which inhibit the
> > > instruction counter in the test from being scheduled - time_enabled > 0
> > > but time_running == 0. This causes the test to fail with division by 0.
> > > Add a sleep loop to ensure that the counter is run before computing
> > > the count.

> > > +
> > > + if (running == 0) {
> >
> > This is not in fact the condition the Changelog calls out.
>
> Not sure I follow. As in the multiplexing? It is exactly the condition
> that time_running == 0.

I meant the condition should be 'enabled && !running'.