Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* 5.1 extremely slow
@ 2002-03-10 10:48 John Firebaugh
  2002-03-10 11:04 ` John Firebaugh
  0 siblings, 1 reply; 3+ messages in thread
From: John Firebaugh @ 2002-03-10 10:48 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Hi,

I've upgraded to 5.1.1 due to bugs in 4.x, but debugging almost any program is 
unbearably slow. I've attached some detailed debug output; here is a summary:

In the file gdb_commands I put:
break main
r
k
q

Compare running the command "time strace -c gdb -x gdb_commands 
src/.libs/gideon" under 4.18 and 5.1.1:

4.18:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 44.44    0.153028          23      6763           ptrace

real    0m4.299s
user    0m2.550s
sys     0m0.810s

5.1.1:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 98.07   26.668416          27    986910           ptrace

real    1m9.949s
user    0m20.750s
sys     0m40.540s

Note the nearly 1 million calls to ptrace with 5.1: more than a hundred-fold 
increase compared to 4.18.

If you need more detailed strace output or any other info, let me know.

Thanks,
John

[-- Attachment #2: gdb_test --]
[-- Type: text/plain, Size: 6210 bytes --]

The contents of gdb_commands:

break main
r
k
q

With gdb 4.18:

john@localhost:~/src/kde/gideon$ time strace -c gdb -x gdb_commands src/.libs/gideon
execve("/usr/bin/gdb", ["gdb", "-x", "gdb_commands", "src/.libs/gideon"], [/* 30 vars */]) = 0
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-unknown-linux-gnu"...(no debugging symbols found)...
Breakpoint 1 at 0x1000b034
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
Breakpoint 1, 0x1000b034 in main ()
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 44.44    0.153028          23      6763           ptrace
 43.86    0.151007         214       705           read
  4.84    0.016659           9      1911           brk
  2.67    0.009180         656        14           write
  0.96    0.003321          33       102        15 open
  0.87    0.002998          35        85           munmap
  0.63    0.002167           4       497           _llseek
  0.48    0.001649          13       129           mmap
  0.22    0.000752           4       173           fcntl64
  0.17    0.000599         599         1           fork
  0.17    0.000586           8        77           close
  0.17    0.000580          13        43           ioctl
  0.14    0.000482           4       122           rt_sigaction
  0.14    0.000466           5        87           fstat64
  0.11    0.000363           9        41           fstat
  0.03    0.000098          25         4         1 stat
  0.03    0.000091           4        26           getrusage
  0.03    0.000091           9        10           wait4
  0.01    0.000041           5         9           kill
  0.01    0.000037          12         3           mprotect
  0.01    0.000031          10         3           stat64
  0.01    0.000030          15         2           getcwd
  0.01    0.000019          19         1           uname
  0.00    0.000014           4         4           setfsuid
  0.00    0.000012           3         4           setfsgid
  0.00    0.000008           4         2           getuid
  0.00    0.000006           3         2           geteuid
  0.00    0.000005           3         2           getgid
  0.00    0.000005           3         2           getegid
------ ----------- ----------- --------- --------- ----------------
100.00    0.344325                 10824        16 total

real    0m4.299s
user    0m2.550s
sys     0m0.810s

With gdb 5.1.1:

john@localhost:~/src/kde/gideon$ time strace -c gdb -x gdb_commands src/.libs/gideon
execve("/usr/bin/gdb", ["gdb", "-x", "gdb_commands", "src/.libs/gideon"], [/* 30 vars */]) = 0
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-linux"...(no debugging symbols found)...
Breakpoint 1 at 0x1000b034
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...[New Thread 1024 (LWP 22645)]
[Switching to Thread 1024 (LWP 22645)]

Breakpoint 1, 0x1000b034 in main ()
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 98.07   26.668416          27    986910           ptrace
  1.67    0.453464         634       715           read
  0.12    0.032433          21      1542           brk
  0.03    0.009060          18       504           _llseek
  0.03    0.007432          85        87           munmap
  0.02    0.005656         354        16           write
  0.02    0.004501          40       112        22 open
  0.01    0.003132          17       183           rt_sigprocmask
  0.01    0.001937          14       137           mmap
  0.00    0.001284          51        25        11 wait4
  0.00    0.000798           5       175           fcntl64
  0.00    0.000737         737         1           fork
  0.00    0.000699          16        44           ioctl
  0.00    0.000571           7        80           close
  0.00    0.000501           4       123           rt_sigaction
  0.00    0.000481           5        90           fstat64
  0.00    0.000302           8        40           fstat
  0.00    0.000096           4        26           getrusage
  0.00    0.000069          23         3         1 stat
  0.00    0.000066          13         5           mprotect
  0.00    0.000061          31         2           getcwd
  0.00    0.000052          13         4           rt_sigsuspend
  0.00    0.000050          25         2         1 access
  0.00    0.000030          10         3           stat64
  0.00    0.000019          19         1           uname
  0.00    0.000019          19         1           poll
  0.00    0.000016           5         3           kill
------ ----------- ----------- --------- --------- ----------------
100.00   27.191882                990834        35 total

real    1m9.949s
user    0m20.750s
sys     0m40.540s

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 5.1 extremely slow
  2002-03-10 10:48 5.1 extremely slow John Firebaugh
@ 2002-03-10 11:04 ` John Firebaugh
  2002-03-10 11:23   ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: John Firebaugh @ 2002-03-10 11:04 UTC (permalink / raw)
  To: gdb

On Sunday 10 March 2002 10:47, John Firebaugh wrote:
> I've upgraded to 5.1.1 due to bugs in 4.x, but debugging almost any program
> is unbearably slow. I've attached some detailed debug output; here is a
> summary:

Update: this is probably the same problem discussed in the thread "gdb and 
dlopen":

http://sources.redhat.com/ml/gdb/2001-10/msg00157.html

Is there a fix for this yet?

-John


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 5.1 extremely slow
  2002-03-10 11:04 ` John Firebaugh
@ 2002-03-10 11:23   ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2002-03-10 11:23 UTC (permalink / raw)
  To: John Firebaugh; +Cc: gdb

On Sun, Mar 10, 2002 at 11:03:39AM -0800, John Firebaugh wrote:
> On Sunday 10 March 2002 10:47, John Firebaugh wrote:
> > I've upgraded to 5.1.1 due to bugs in 4.x, but debugging almost any program
> > is unbearably slow. I've attached some detailed debug output; here is a
> > summary:
> 
> Update: this is probably the same problem discussed in the thread "gdb and 
> dlopen":
> 
> http://sources.redhat.com/ml/gdb/2001-10/msg00157.html
> 
> Is there a fix for this yet?

Not yet.  It's a tricky problem, because we lose the ability to set
breakpoints in early functions in shared libraries if we fix it.

You aren't seeing that problem specifically as much as the hideous
performance of the threads package.  There's no way to disable thread
debugging (should we add a set for that?  I think we should!) but you
can temporarily remove or make unreadable /lib/libthread_db.so.1 to
disable it.  It will automatically kick in if you are linked to
-lpthread.

We need to address some of the performance concerns of this code very
badly.  I have a few ideas but they will not be in time for 5.2.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-10 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-10 10:48 5.1 extremely slow John Firebaugh
2002-03-10 11:04 ` John Firebaugh
2002-03-10 11:23   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox