public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17822] New: Loading shared library is magnitude slower than run a program + dlopen/depend on the same library
@ 2015-01-09 14:45 myocytebd at sina dot com
  2015-01-10  1:44 ` [Bug gdb/17822] " myocytebd at sina dot com
  2015-01-12 23:26 ` dje at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: myocytebd at sina dot com @ 2015-01-09 14:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17822

            Bug ID: 17822
           Summary: Loading shared library is magnitude slower than run a
                    program + dlopen/depend on the same library
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: myocytebd at sina dot com

Loading shared library is extremely slow, compared to load a program and dlopen

Platform:
Ubuntu 13.10, gdb-7.6
Ubuntu 14.10, gdb-7.8

Problem:
Use "file" command to directly load a shared library is extremely slow.
Magnitudes slower than loading a program that dlopen(), or simply depends on
the same library.

Details:
There is a (symbol-wise) light program programX, which at run-time, dlopen() a
few heavy libraries libA, libB, libC ...

1. gdb programX and run. It takes ~10 minutes to load all libraries.
2. gdb -ex "file libA" alone, takes > 1 hour, maybe infinitely. (I killed it)
(Loading individual shared library was used to generate gdb-index.)


"sudo perf top" top rankers are stable
   8.87%  libc-2.19.so                   [.] _IO_file_seekoff@@GLIBC_2.2.5
   8.85%  libc-2.19.so                   [.] __lseek_nocancel
   8.27%  [kernel]                       [k] system_call
   7.31%  libc-2.19.so                   [.] fseeko
   6.75%  libc-2.19.so                   [.] _IO_fread
   6.63%  [kernel]                       [k] system_call_after_swapgs
   6.62%  [kernel]                       [k] __fget_light
   4.39%  gdb                            [.] bfd_seek
   3.85%  [kernel]                       [k] ext4_llseek
   3.66%  gdb                            [.] _bfd_generic_get_section_contents
   3.39%  libc-2.19.so                   [.] _IO_file_xsgetn
   3.38%  [kernel]                       [k] sys_lseek
   3.07%  gdb                            [.] bfd_get_section_contents
   1.88%  gdb                            [.] bfd_bread
   1.84%  [kernel]                       [k] sysret_check
   1.84%  [kernel]                       [k] __fdget_pos
   1.68%  gdb                            [.] bfd_getl32
   1.47%  [kernel]                       [k] generic_file_llseek_size
   1.22%  libc-2.19.so                   [.] _IO_seekoff_unlocked
   0.96%  libc-2.19.so                   [.] __memcpy_sse2
   0.73%  gdb                            [.] 0x00000000002b31c0
   0.62%  libc-2.19.so                   [.] _IO_sgetn
   0.61%  libc-2.19.so                   [.] _IO_file_seek
   0.55%  [kernel]                       [k] copy_user_generic_string
   0.50%  [kernel]                       [k] system_call_fastpath

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug gdb/17822] Loading shared library is magnitude slower than run a program + dlopen/depend on the same library
  2015-01-09 14:45 [Bug gdb/17822] New: Loading shared library is magnitude slower than run a program + dlopen/depend on the same library myocytebd at sina dot com
@ 2015-01-10  1:44 ` myocytebd at sina dot com
  2015-01-12 23:26 ` dje at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: myocytebd at sina dot com @ 2015-01-10  1:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17822

myocytebd at sina dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED

--- Comment #1 from myocytebd at sina dot com ---
The problem seems fixed with latest snapshot.


Updated bug description:

gdb-7.6, Ubuntu 13.10
whole program: ~10min
one library: extremely slow (> 1 hour; killed)

gdb-7.8, Ubuntu 14.10
whole program: extremely slow (> 1 hour; killed)
one library: extremely slow (> 1 hour; killed)

latest gdb snapshot, Ubuntu 14.10
(configured without no options)
whole program: ~2min  (a lot faster; the annoying seek hotspot seems no longer)
one library: good (faster than whole program; the annoying seek hotspot seems
no longer)


The whole program is ~1.5M symbols,
with three heavy libraries ~400k each.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug gdb/17822] Loading shared library is magnitude slower than run a program + dlopen/depend on the same library
  2015-01-09 14:45 [Bug gdb/17822] New: Loading shared library is magnitude slower than run a program + dlopen/depend on the same library myocytebd at sina dot com
  2015-01-10  1:44 ` [Bug gdb/17822] " myocytebd at sina dot com
@ 2015-01-12 23:26 ` dje at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dje at google dot com @ 2015-01-12 23:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17822

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at google dot com

--- Comment #2 from dje at google dot com ---
Maybe a dupe of this bug?
https://sourceware.org/bugzilla/show_bug.cgi?id=17677

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2015-01-12 23:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-09 14:45 [Bug gdb/17822] New: Loading shared library is magnitude slower than run a program + dlopen/depend on the same library myocytebd at sina dot com
2015-01-10  1:44 ` [Bug gdb/17822] " myocytebd at sina dot com
2015-01-12 23:26 ` dje at google dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).