Re: [PATCH v2] tools/power turbostat: Fix RAPL summary collection on AMD processors

From: Borislav Petkov
Date: Fri Apr 23 2021 - 10:29:57 EST


On Fri, Apr 23, 2021 at 10:00:14AM -0400, Calvin Walton wrote:
> So, there's two problems with that:
> 1. This function needs to be able to return an error value that cannot be
> confused with a valid MSR. This is currently done by returning a
> negative number. If an unsigned value is used, a different way of
> indicating errors needs to be written.
> 2. We are not using CPU instructions to access MSRs direction. Instead
> they are being read from /dev/msr. So the "offset" value is actually a
> seek into the /dev/msr file (using pread), and thus is of type off_t.

Ah right, that's the /dev/msr thing. Then off_t is correct, forget what
I said.

Thx.

--
Regards/Gruss,
Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg