mod_perl2 & Devel::NYTProf
This week I’ve been trying to switch us over to using mod_perl2. I wanted to cache database handles as much as possible so one of the first things that I did was edit my startup.pl and add:
Most stuff just works. When I find something that is only slightly broken, I fix it. When I find something that is horribly broken, I just create a Location in httpd.conf to tell Apache to run that as plain CGI and I’ll update them later.
The entire application suite feels faster. I suspect much of the speed up is due to caching database handles but I’d like to profile it. I have no problems profiling CGI with Devel::NYTProf. When I configure httpd.conf to use Devel::NYTProf::Apache like this I get issues.
PerlSetEnv NYTPROF trace=2:file=/tmp/mm-nytprof.out:addpid=1:start=begin:use_db_sub=1 PerlModule Devel::NYTProf::Apache
I guess I’ll have to file a bug report. Here is just one of the many issues showing up in the error log:
Marking 'Apache2::RequestRec::args' as xsub Marking 'CGI::Cookie::CORE:subst' as sop Marking 'CGI::Cookie::CORE:substcont' as sop NYTProf is confused about CV 0x2ac1ed3023e0 called as /opt/perl/lib/site_perl/5.12.3/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm at /opt/perl/lib/site_perl/5.12.3/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm line 225 (please report as a bug) SV = PVCV(0x2ac1ed2b49d0) at 0x2ac1ed3023e0 REFCNT = 2 FLAGS = (POK,pPOK,CONST) PROTOTYPE = "" COMP_STASH = 0x2ac1ed240ad0 "ModPerl::RegistryCooker" XSUB = 0x2ac1d2d845b0 XSUBANY = 0x2ac1ed2d0da8 (CONST SV) SV = IV(0x2ac1ed2d0da0) at 0x2ac1ed2d0da8 REFCNT = 2 FLAGS = (PADMY,IOK,READONLY,pIOK) IV = 0 GVGV::GV = 0x2ac1ed2d2910 "" FILE = "/opt/perl/lib/site_perl/5.12.3/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm" DEPTH = 0 FLAGS = 0xc00 OUTSIDE_SEQ = 0 PADLIST = 0x0 OUTSIDE = 0x0 (null) unknown entersub xsub assumed to be anon called_cv '/opt/perl/lib/site_perl/5.12.3/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm'
Is there a way to tell Devel::NYTProf not to profile ModPerl::RegistryCooker?