RE: [PATCH V5 4/8] perf/x86/intel/uncore: add new data structures for free running counters

From: Liang, Kan
Date: Tue Jan 23 2018 - 17:01:07 EST


> On Fri, Jan 19, 2018 at 12:24:17PM -0800, Andi Kleen wrote:
> > > Oh, think a bit more.
> > > I think we cannot do the same thing as we did for CPU PMU's fixed
> counters.
> > >
> > > The counters here are free running counters. They cannot be start/stop.
> >
> > Yes free running counter have completely different semantics. They
> > need a separate event code.
>
> The only thing that matters is if they count the same thing or not.
>

Hi Peter,

There is NO event available on the GPs, that is exactly the same as
the free-running counters.

For example, the BW free-running counters count the requests associated
with writes and completions.
The most similar events on the GPs are DATA_REQ_{OF,BY}_CPU.* events.
Except that some of their sub-events count requests which not completions.
There are also other minor differences.
So we don't have alternative events for the free-running counters.
I think we have to use 0xff.

For details, please refer to the uncore PMU guide.
https://www.intel.com/content/www/us/en/processors/xeon/scalable/xeon-scalable-uncore-performance-monitoring-manual.html

Thanks,
Kan

> The not start/stop thing is not important. See arch/x86/events/msr.c on how
> to deal with that. The short story is that you simply ignore stop and update
> the prev_count on start. Then any next update will increment with the
> correct delta.
>
> (if the counter is short you also need to run a timer to deal with wraps).