I've just tried it out on my linux x86_64 system with mod_perl 2.03 and apache 2.2.4 using a preforked MPM, and it works fine. You need to do the following:
- Install the latest Apache::DProf
- Make sure your mod_perl is version >=2
- Make sure that mod_perl has PerlChildInitHandlers enabled - for a stock install, I'm sure this would be the case
- Create the dir logs/dprof and make it writable by the user apache runs under
- Add PerlModule Apache::DProf into your httpd.conf file, or make it the first module loaded in your startup.pl file
- apachectl start should create a number of dirs under logs/dprof named after the process ID of each apache child, with a tmon.out file in each directory - I'm using
- Run a few requests that involve your mod_perl code
- Shut down the server - nothing will be written to the tmon.out files until the server shuts down (or the buffer fills up)
That's the process I followed, and it works. If this isn't working for you, then give us some more details of your apache, mod_perl and how you configured Apache::DProf.
Things to think about:
- Are you actually hitting mod_perl code?
- Are you looking at all the tmon.out files, because if you have 5 children, and make a few requests, they may all go to just one child, and so the profiling will be written to just one of the five tmon.out files.
- Are you using the preforked MPM or the threaded MPM? I don't know if it will make any difference, but threads and mod_perl can present problems that we don't normally see. It SHOULD work, but I haven't tried it.
- Are you loading Apache::DProf before any other modules? It doesn't mention it in the docs, and seems to work for me either way, but try it
Clint