On Tue, Sep 13, 2005 at 01:29:41PM +0200, Rafael Garcia-Suarez wrote:

> Alan Burlison wrote:
> > I'd be more than happy to do it in a module, but I'm not clear how I 
> > would replace functions in libperl from a module.
> 
> Your module could, for example, replace the op_ppaddr fields of the
> ops you want to intrument with your own DTrace-enabled implementation.
> 
> (I note that every op has an op_ppaddr field, which is probably some
> memory overhead. However that also means that you can instrument only
> part of the optree)

If you take this route remember that the optree is shared between
threads which can make things even more interesting.  Been there, done
that, the wounds are still open.

> Or your module can replace the runloop and provide alternate
> implementations directly in it for the ops you want to instrument.

That being a logical or.

> > The whole point of 
> > dtrace is that it is lightweight enough to leave it in the code all the 
> > time.  Loading an additional module normally requires that you 
> > stop/start the application, embedding the probes would mean you could 
> > enable the probes on the fly.
> 
> That's a significant point for enabling DTrace at compile time in perl.

If you can come up with a generic lightweight method of instrumenting
subroutine entry and exit I can think of a few interesting applications
and I'm sure others could think of many more.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to