You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/11/21 18:23:00 UTC

profiling mod_perl DSO?

I've recompiled httpd with CFLAGS=-pg and mod_perl MP_CCOPTS='-pg'. I 
can see the profile of httpd but not a single function from 
libmodperl.so. Should I do something special, because it's DSO?

After running 't/TEST -d' / 't/TEST -run' I get:
/home/stas/apache.org/mp-subproc/t/htdocs/gmon.out
/home/stas/apache.org/mp-subproc/t/gmon.out
/home/stas/apache.org/mp-subproc/gmon.out

with mostly I think real data in t/htdocs/gmon.out

when I run gprof on these I don't see modperl calls profiled.

Why am I profiling? I've figured by trial and error that about 15 secs 
are spent in one require (see my previous post), I still miss 30 secs 
somewhere spent by gdb, I thought that the profiler will be the best 
tool to use to figure it out.

I think that disabling GTOP have improved the speed as well. Don't have 
the numbers yet.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: profiling mod_perl DSO?

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:

> i doubt gprof will be helpful here.  if it was, you'd be better of just
> profiling perl's startup time with the perl binary outside of httpd.


well, I was doing killall -SEGV httpd while running TEST -d and 
everytime the trace was deep inside Perl stack, and it also looks the 
same all the time. The stack is huge, about 35 frames deep.

Is there a way to see how much time is spent where? Why gprof won't help?

In any case how do I get libmodperl.so profiled? after compiling it and 
httpd with -pg, is that because perl itself wasn't compiled with -pg? 
but then I was looking for functions in mod_perl.c which is in httpd 
domain. Also from stepping through the code with ddd, I know that it 
stops for a big break in one 'ifdef GTOP' and the first startup require.


> also you didn't mention which verison of perl you're using.  assuming
> bleed, you might want to benchmark its startup time vs. 5.6.1,
> slowdown could be something new.  


only bleed, but I've just tried with 5.6.1, the same picture. Whenever I 
report things assume that it's all the latest bleed :)

> what is the difference in startup time
> between t/TEST -d and t/TEST -start ?

startup: 2-6 secs
debug  : 45-60 secs

on my slower laptop -d takes up to 90 secs to start.

The thing that drives me crazy is that you don't see this problem and 
Gozer doesn't see it and you all run linux with 2.4 kernel. I've been 
trying to eliminate other factors, like network (just keeping lo 
running) but nothing changes.

The thing is that I need to debug C stuff, and it's so irritating that 
you have to wait for so long everytime you change a bit (added to 
compile time) to debug it :(

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: profiling mod_perl DSO?

Posted by Doug MacEachern <do...@covalent.net>.
i doubt gprof will be helpful here.  if it was, you'd be better of just
profiling perl's startup time with the perl binary outside of httpd.
also you didn't mention which verison of perl you're using.  assuming
bleed, you might want to benchmark its startup time vs. 5.6.1,
slowdown could be something new.  what is the difference in startup time
between t/TEST -d and t/TEST -start ?



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org