Dave Mitchell wrote:
If you're talking about producing a special perl binary that does this, it would be trivial - just a quick mod to pp_entersub. - wouldn't even need to call find_runcv, since entersub knws the CV its calling.
And a corresponding mod to pp_leavesub I guess and pp_leavesubv? Any suggestions for the best place to insert the trace call into pp_entersub? Somewhere around the 'now we have permission to enter the sub' comment?
Doing something via dynamically loadable XS would be harder - not sure how that could be done.
The whole point of dtrace probes is to leave them in place as they are lightweight enough to do so - the laptop I'm typing this on has 40,877 of them available in stock Solaris kernel, for example. I'm envisioning this being a Solaris-only build time option rather than a loadable module - as you point out it would be v. hard to do this from an XSUB.
-- Alan Burlison --