httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Carlson <jcarl...@jnous.com>
Subject How to profile apache?
Date Wed, 09 Apr 2003 01:55:57 GMT
Hello,
   I'm sure this is an oft answered question, but I can't seem to get useful 
data from gprof with apache.  I've tried compiling Apache with the following 
configure line:

   CC=gcc CFLAGS="-pg -DGPROF" ./configure

and running it with:

   bin/httpd -X

after which I use httperf to generate many requests and 'apachectl -k stop' to 
shut it down gracefully.  However, the gmon.out which is created (viewed with 
'gprof -z bin/httpd') doesn't seem to have any timing data from after the server 
  config process.  For instance, ap_run_post_config is called once, but 
ap_run_handler is called never (according to gprof).

Now I am guilty of the following: I commented out the definition of 
MONCONTROL(), because gcc on Solaris defines it statically (OT but: is this ever 
going to be fixed?) -- however, shouldn't the -X option obviate the need for 
turning off/on profiling in the parent/child?  At any rate, I would like to 
profile under Solaris, but I am willing to rig up a linux box if this will help.

Lastly, my real goal is to profile my own module under load.  I'm concerned that 
getting gprof to display info on a dlopen'ed .so will also be a challenge -- so 
if anyone can advise me on that, it would be appreciated (this would also allow 
me to see symbols from libapr.so).  (After much googling, I haven't found much 
on the relationship between gprof and DSO's, other than some cryptic references 
to DL_PROFILE.)  I believe my current problem is logically prior, however, 
because the core, http_core modules are compiled into httpd, and I'm not getting 
info from them either.

Any help is much appreciated!!  Thanks,

Jim

p.s. relevant specs:

Apache/2.0.44 (pretty much a stock build, except for the ./configure line given 
above)
Compiled in modules:
   core.c
   mod_access.c
   mod_auth.c
   mod_include.c
   mod_log_config.c
   mod_env.c
   mod_setenvif.c
   prefork.c
   http_core.c
   mod_mime.c
   mod_status.c
   mod_autoindex.c
   mod_asis.c
   mod_cgi.c
   mod_negotiation.c
   mod_dir.c
   mod_imap.c
   mod_actions.c
   mod_userdir.c
   mod_alias.c
   mod_so.c

gcc 3.2.2
SunOS valkyrie 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-5_10


Mime
View raw message