perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: perlrequire/perlmodule are running twice and slow
Date Mon, 26 Nov 2001 18:02:57 GMT
Daniel Jacobowitz wrote:

> On Mon, Nov 26, 2001 at 06:18:43PM +0800, Stas Bekman wrote:
> 
>>Daniel Jacobowitz wrote:
>>
>>
>>
>>>>The thing that drives me crazy is that neither Doug nor Philip who both 
>>>>use almost the same version of everything on linux and using the same 
>>>>build options don't have this huge startup lag. I cannot figure out what 
>>>>it is that is different on my system that only I see this problem :( Any 
>>>>hints? I was trying to profile the startup to figure out where gdb 
>>>>spends most of the time but first I couldn't get any DSO loaded gprof 
>>>>data second I'm not sure I can really catch it. Should I use kernel 
>>>>level tracing? strace doesn't reveal anything interesting, it shows the 
>>>>PTRACE_PEEKTEXT op all the time, but nothing else I can use to aid my 
>>>>tracing.
>>>>
>>>>
>>>Is it possible that Doug and Philip do not have libthread_db installed,
>>>in which case GDB won't try to be thread-aware?  Or, actually, it could
>>>be a gdb version issue.  The slowness came with the current
>>>thread-aware debugging package, which is fairly recent (snapshots from
>>>a year ago through the release last week).
>>>
>>
>>I've checked, Philippe has libthread_db and running the same gdb version 
>>(the same release but he is on RH, while I'm on Mandrake Linux).
>>
> 
> Interesting.  Perhaps RH had a separate patch applied; which version is
> this?


I've a bunch of them, but I think that the one in /lib/ that's used:

% urpmf libthread_db
glibc:/lib/libthread_db-1.0.so
glibc:/lib/libthread_db.so.1
glibc_lsb:/lib/lsb/libthread_db-1.0.so
glibc_lsb:/lib/lsb/libthread_db.so.1
glibc-devel:/usr/lib/libthread_db.so
glibc_lsb-devel:/usr/lib/lsb/libthread_db.so

what should I ldd to figure out which one is used?


> Also, you might want to see if setting auto-solib-add to 0 speeds you
> up.  You'll need to add them by hand (I think "sharedlibrary" or "info
> sharedlibrary" will do it) before setting breakpoints in them, but that
> may be fine for your use.


Whoah! That makes a huge difference!

with this -commands file:

handle SIGPIPE pass
handle SIGPIPE nostop
set auto-solib-add 0
b apr_poll
run -DONE_PROCESS -d /home/stas/apache.org/mp-subproc/t -f 
/home/stas/apache.org/mp-subproc/t/conf/httpd.conf -DAPACHE2 
-DPERL_USEITHREADS

I get the gdb prompt in less than 5 secs! That's so sweet :) the only 
problem now is that I need to craft gdb command files to load the 
symbols that I want to debug, but I can live with that.

I can see what shared libraries it has loaded (without reading the 
symbol table) with 'info sharedlibrary' and then I force gdb to read the 
symbols from the wanted library using 'sharedlibrary regex' and voila, I 
can set the breakpoint.

Thanks a lot for this very timely help, Daniel!

While we are on this topic, do you know of a good book about gdb, shared 
libs, symbols, linking and stuff? The manuals are useful, but I'm really 
looking for a good book about this material, as I see many books that 
mention a bit but none does indepth coverage. The book "PANIC! UNIX 
System Crash, Dump Analysis" seems to be exactly what I'm looking for, 
but it's not very useful as it uses Sun's proprietary tools :(

_____________________________________________________________________
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


Mime
View raw message