Re: [PATCH v4 1/7] perf: arm64: Add test to check userspace access to hardware counters.
From: Rob Herring
Date: Wed Jun 03 2020 - 12:19:25 EST
On Tue, Aug 27, 2019 at 07:17:55PM +0800, Jonathan Cameron wrote:
> On Thu, 22 Aug 2019 15:42:14 +0100
> Raphael Gault <raphael.gault@xxxxxxx> wrote:
>
> > This test relies on the fact that the PMU registers are accessible
> > from userspace. It then uses the perf_event_mmap_page to retrieve
> > the counter index and access the underlying register.
> >
> > This test uses sched_setaffinity(2) in order to run on all CPU and thus
> > check the behaviour of the PMU of all cpus in a big.LITTLE environment.
> >
> > Signed-off-by: Raphael Gault <raphael.gault@xxxxxxx>
>
> Hi Raphael,
>
> I just tested this on 1620 and it works fairly nicely with one exception...
I'm working on reviving this series.
> The test will run and generate garbage numbers if the rest of the
> series isn't yet applied to the kernel. Is there anything we can do
> to prevent that?
I've added a check that user access is enabled which should prevent
that. It also validates pmc_width is set which was missing in this
series.
> It's a slightly silly complaint, but this also take a while compared to all
> the other tests if you have lots of cores, so maybe a slightly shorter
> test?
I'm not sure what the value of running on every core was supposed to be.
If we want to check big.LITTLE, then the test should detect that and
pass if user access is disabled on all cores. If we're not on
big.LITTLE, then I don't see the point in this test running on every
core.
Rob