Re: [PATCH 1/2] perf/x86/intel: enable CPU ref_cycles for GP counter

From: Andi Kleen
Date: Wed May 24 2017 - 12:55:56 EST


> The whole point of the rdpmc() implementation is to be low overhead.
> If you have to parse 10 different mmap() fields it starts to defeat the
> purpose.

You would only use it with ref-cycles of course. So for the normal
case there is no overhead.

> If the watchdog counter is constantly running, can't you just modify
> perf_event to just grab start/stop values at context switch time and
> provide the difference to the user? Sort of like the "always running"
> patchsets that float around? Though I guess that doesn't help much with
> sampling.

This wouldn't work with ring filters unfortunately.

-Andi