Hello,
On 05/05/2010 11:06 AM, Peter Zijlstra wrote:
Hmm... yeah, we'll need NOP functions for every missing hook. Might
as well just spell each one out.
Ah, okay, you mean the code complexity overhead. Eh well, if you
wanna do it on-demand, there's certain amount you need to pay. As
long as the runtime overhead on hotpath isn't increased, I don't think
it's too bad tho.
Things would have been much prettier if PERF could simply depend on
TRACEPOINTS. More on this later.
The thing is that unifying hooks not only saves the extra check now
but also makes future optimizations much easier. ie. Ingo was talking
about run time patching TPs so that disabled ones just become noops.
It's far better to have all the tracing stuff on single hooking
mechanism for optimization efforts like that.
As I wrote above, here, the problem is mostly cosmetic. It's just
that kvm hook needs irq on while perf hook can save one irq flipping
if called with irq off. If we call them separately, there's no
problem. If we wanna colocate them, it makes sense to pull perf hook
out of irq disabled section. This one doesn't really make that much
of a difference.
I was wondering the other way around - ie. the possibility to make
perf optional and maybe even as a module which depends on TPs, which
would be nicer than the current situation and make the code less
cluttered too.
Thanks.
--
tejun
--