in reply to Measuring mod_perl with Apache::DProf

Make sure you really call Apache::DB->init before loading any of the code you want to profile. From the article:
Note that you must call Apache::DB->init(); prior to whatever code you are attempting to debug. To be safe, I always just put it as the very first thing in my startup.pl.
  • Comment on Re: Measuring mod_perl with Apache::DProf

Replies are listed 'Best First'.
Re^2: Measuring mod_perl with Apache::DProf
by redhotpenguin (Deacon) on Dec 07, 2007 at 06:57 UTC

    Thanks for the spot, I missed that one. I remember something about needing to call ->init but when I reviewed the docs this seemed to indicate I didn't need to do anything more than load the module. I'll give that a shot. I've also been starting to use dtrace so it should be interesting to compare the results of the two.

    The Apache::DProf module also requires apache version 1.3b3 or higher +and PerlChildInitHandler enabled. It is configured simply by adding t +his line to your httpd.conf file: PerlModule Apache::DProf

    UPDATE - ->init didn't change anything, so it looks like that wasn't the issue. To convince myself that I was looking at valid results I created a subroutine:

    sub sleepy { sleep 10; }

    and I call sleepy() from My::Handler::handler. The ExclSec for My::Handler::handler is 10.47 seconds, and My::Handler::sleep is nowhere to be seen in the profile.