Re: perf: rdpmc and PERF_EVENT_IOC_RESET

From: Vince Weaver
Date: Thu Aug 18 2016 - 00:33:36 EST


On Wed, 17 Aug 2016, Peter Zijlstra wrote:

> Hurm.. I never considered using RESET with rdpmc(). The typical usage of
> rdpmc() I considered is something like:

I'm finally trying to hook up PAPI to properly use rdpmc and PAPI likes to
use IOC_RESET in various places. I can just special case to not do so
when in rdpmc mode, but I got curious if RESET was expected to work.

> But the rdpmc user function should:
> ...
>
> Which sign-extends the RDPMC result and adds it to userpg->offset,
> resulting in a positive number again.

I will have to check to see if PAPI is using the proper code.
What happens is the procesed result has bit 49 set for some reason, so the
results are 2^49 too big. I've been trying to track it down, but the PAPI
code is a bit of a mess (to put it mildly).

Vince