lkml.org 
[lkml]   [2021]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/3] libperf: Add processing to scale the counters obtained during the read() system call when multiplexing
Date
Hi, Rob

> On Fri, Aug 20, 2021 at 06:39:06PM +0900, Shunsuke Nakamura wrote:
> > perf_evsel__read() scales counters obtained by RDPMC during multiplexing, but
> > does not scale counters obtained by read() system call.
> >
> > Add processing to perf_evsel__read() to scale the counters obtained during the
> > read() system call when multiplexing.
>
> Which one is right though? Changing what read() returns could break
> users, right? Or are you implying that the RDPMC path is correct and
> read() was not. More likely the former case since I wrote the latter.

perf_evsel__read() returns both the count obtained by RDPMC and the count obtained
by the read() system call when multiplexed with RDPMC enabled.

That is, there is a mix of scaled and unscaled values.

As Rob says, when this patch is applied, rescaling the count obtained from
perf_evsel__read() during multiplexing will break the count.

I think the easiest solution is to change the value you get from RDPMC to not scale
and let the user scale it, but I thought it would be a little inconvenient.

Best Regards
Shunsuke
\
 
 \ /
  Last update: 2021-08-24 12:19    [W:0.123 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site