Re: [RFC] Sharing PMU counters across compatible events

From: Tejun Heo
Date: Mon Dec 11 2017 - 10:34:57 EST


Hello, Jiri.

On Wed, Dec 06, 2017 at 12:42:04PM +0100, Jiri Olsa wrote:
> I see this rather on the hw level, since it concerns HW counters
>
> I think we could detect same (alias) events at the time counters
> are added/removed on/from the cpu and share their HW part like
> counter idx, regs and such (struct hw_perf_event_cpu in my changes)
>
> this way it'd be completely transparent for generic code

I don't quite follow why doing this in arch code is better than
generic. Doing this in arch means we'd need to do the same thing
multiple times for different archs. Why is that better?

Thanks.

--
tejun