Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: "André Pönitz" <andre.poenitz@mathematik.tu-chemnitz.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 5/4 take 2] Improved linker-debugger interface
Date: Fri, 20 Jul 2012 10:02:00 -0000	[thread overview]
Message-ID: <20120720100222.GC3153@redhat.com> (raw)
In-Reply-To: <20120719211740.GB2947@klara.mpi.htwm.de>

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

André Pönitz wrote:
> On Thu, Jul 19, 2012 at 04:19:13PM +0100, Gary Benson wrote:
> > Attached is a patch to avoid calling update_section_map from the
> > probes interface.  Updated timings are as follows:
> > 
> >   no of solibs    100     250     500     1000    2000    5000
> >   ------------------------------------------------------------
> >   old interface     1       3       9       35     141     942
> >   new interface     0       0       1        4      14      89
> >   (times in seconds)
> > 
> > So, with this patch GDB is not three but ten times faster.
> 
> It pretty much looks like there is still some quadratic behaviour
> somewhere...

Yes.  It's difficult to avoid given the current architecture.
target_so_ops->current_sos() is expected to return a freshly
allocated list of libraries to update_solib_list(), and the
latter is expected to free them.  This makes sense for the
standard interface, which reads everything from the inferior
into a list and returns it.  The probes interface already has
everything read by the time target_so_ops->current_sos() is
called, but it can't just return its own copy because the
rest of GDB will start freeing bits of it, so it needs to
copy it.  Every time a library is loaded, a new copy of the
list is made, but every time a library is loaded the list is
one element bigger.  You can see all the memcpy calls in the
profile I attached.

Cheers,
Gary

-- 
http://gbenson.net/

[-- Attachment #2: profile --]
[-- Type: text/plain, Size: 1334 bytes --]

samples  %        image name     symbol name
-------------------------------------------------------------------------
347937   11.4258  no-vmlinux     /no-vmlinux
317639   10.4309  libc-2.13.so   __memcpy_sse2
231494    7.6020  gdb            lookup_minimal_symbol_text
230405    7.5662  gdb            objfile_data
206993    6.7974  libc-2.13.so   __GI_memset
169853    5.5778  gdb            svr4_same
154056    5.0590  gdb            lookup_minimal_symbol
105589    3.4674  libc-2.13.so   _int_free
99916     3.2811  gdb            solib_add
93557     3.0723  libc-2.13.so   _int_malloc
78125     2.5655  gdb            namespace_update_incremental
74170     2.4357  gdb            create_longjmp_master_breakpoint
70165     2.3041  libc-2.13.so   __strcmp_sse2
62896     2.0654  gdb            lookup_minimal_symbol_and_objfile
55876     1.8349  gdb            create_overlay_event_breakpoint
51030     1.6758  gdb            get_objfile_arch
46512     1.5274  gdb            create_exception_master_breakpoint
45851     1.5057  gdb            create_std_terminate_master_breakpoint
40766     1.3387  ld-2.16.90.so  _dl_name_match_p
40233     1.3212  gdb            allocate_objfile
34723     1.1403  ld-2.16.90.so  _dl_map_object_from_fd
33676     1.1059  libc-2.13.so   freehook
31009     1.0183  ld-2.16.90.so  _dl_map_object

  reply	other threads:[~2012-07-20 10:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 15:19 Gary Benson
2012-07-19 19:23 ` dje
2012-07-20  9:33   ` Gary Benson
2012-07-19 21:17 ` André Pönitz
2012-07-20 10:02   ` Gary Benson [this message]
2012-07-25 18:19     ` Tom Tromey
2012-07-25 18:22 ` Tom Tromey
2012-07-31 12:21   ` Gary Benson
2012-07-31 14:44     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120720100222.GC3153@redhat.com \
    --to=gbenson@redhat.com \
    --cc=andre.poenitz@mathematik.tu-chemnitz.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox