Re: [RFC 00/21] perf tools: Add toggling events support

From: Andi Kleen
Date: Thu Sep 26 2013 - 11:45:25 EST


> > It would be better to keep counting and just do RDPMC on the switch
> > points, and then subtract for counting. For sampling could need a MSR
> > write to enable/disable. Still somewhat expensive, but nowhere near as
> > bad as a full switch.
>
> This is essentially an optimized event switch and should probably be done
> on a higher level so that other instances of event/context switching
> benefit as well.

Ok. Need to be a bit careful and it cannot be done in all cases.

For non global counters this only works if RDPMC is disabled, otherwise
it leaks counter interformation between unrelated processes, which
may be a security problem.

-Andu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/