From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: performance talk [Re: RFC: implement DW_OP_bit_piece]
Date: Tue, 25 May 2010 22:23:00 -0000 [thread overview]
Message-ID: <m3bpc3prk1.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20100525174253.GA12968@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Tue, 25 May 2010 19:42:53 +0200")
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Tom> If you know of specific bad cases, I'm very interested in that.
Tom> I think we understand the symbol reading problem pretty well now, but
Tom> other stuff could at least use bug reports.
Jan> Checked now we were talking about `attach' being fast enough (~2s
Jan> on OOo.org) but I was testing it with
Jan> `archer-tromey-delayed-symfile2'. Then `bt full' is still slow -
Jan> tens of secs.
Yeah, this is known. See below.
At this point I'm much more interested in performance problems elsewhere
in gdb. This particular one is, while not "solved", at least very well
explored. A solution is on the horizon...
Here's a dump of the status:
This particular branch uses the aranges section to lazily read DWARF.
This makes "attach" very fast, because we don't hit the disk very much.
However, "bt" and "bt full" are still quite slow. If you want the bt
output for OO.o you can actually see it pause for a noticeable amount of
time at one particular point.
What is happening here is that at this point we need some particular
piece of debuginfo (I think a type, but I am not sure I looked into the
details). Since we don't have any sort of by-name index, we have to
read psymtabs and then search.
The fix for this is to add a by-name map. You might think we could use
debug_pubnames and debug_pubtypes, but those are broken beyond repair
for various reasons: historical gcc bugs make them unreliable, they
don't mention everything gdb needs, they aren't canonicalized, and
what's worse, it turns out that actually reading them in is too slow.
This is where the mmap()able debug index comes in. This approach yields
good attach times *and* good backtrace times, at the cost of having to
build a separate index per objfile. If you want to try this, it is all
on archer-tromey-optional-psymtab. I can tell you how to make the index
files if you do this.
What makes this fast is that the by-name index means we can just read
the CUs we care about. Reading any particular CU is fast enough that we
don't need anything smarter.
I am planning to propose this as an F14 feature: make index files for
all the debuginfo, and at the same time drop .debug_pub* (to save some
space). I figured I would delay submission to FSF gdb until we get this
underway; my view is that this is more of a "distro" feature (creating
the index files is just as slow as simply starting gdb) and there is no
point in pushing it if the distro isn't interested.
Another idea I implemented is to read psymtabs in the background. This
works pretty well: gdb starts some worker threads and reads in psymtabs
starting with the largest one (the smaller the debuginfo, the less
likely you are to notice the pause).
I haven't submitted this for two reasons.
First, it is not quite complete. It has a questionable BFD hack, and I
haven't yet made the complaint() system threadsafe.
Second, I assume it will be contentious and/or too ugly. It uses
__thread in various spots and it changes cp-name-parser.y to depend on
bison (by making it a pure parser), not to mention that threads are
widely hated.
I'd be happy to revisit this if people are interested. Note that it is
not as good as the index approach.
These two approaches are actually complementary. We could put them both
in.
Finally, one or both of these branches has a little optimization so that
if you "gdb -readnow", we don't create psymtabs at all. This could go
in now; I just haven't bothered since I think -readnow is only ever
actually used to locate psymtab expansion bugs.
Tom
prev parent reply other threads:[~2010-05-25 22:03 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-18 23:43 RFC: implement DW_OP_bit_piece Tom Tromey
2010-05-19 14:16 ` Stan Shebs
2010-05-19 23:35 ` Tom Tromey
2010-05-20 3:29 ` Stan Shebs
2010-05-20 5:10 ` Tom Tromey
2010-05-20 7:12 ` Tom Tromey
2010-05-26 22:41 ` Tom Tromey
2010-06-03 20:12 ` RFA: rewrite dwarf->ax translator (Was: RFC: implement DW_OP_bit_piece) Tom Tromey
2010-06-08 20:45 ` RFA: rewrite dwarf->ax translator Tom Tromey
2010-06-11 15:20 ` Tom Tromey
2010-06-08 20:52 ` RFA: rewrite dwarf->ax translator (Was: RFC: implement DW_OP_bit_piece) Pedro Alves
2010-06-08 21:21 ` RFA: rewrite dwarf->ax translator Tom Tromey
2010-06-08 22:48 ` Tom Tromey
2010-06-09 14:04 ` Pedro Alves
2010-07-01 12:43 ` collecting optimized out variables regression (Re: RFA: rewrite dwarf->ax translator (Was: RFC: implement DW_OP_bit_piece)) Pedro Alves
2010-07-01 15:25 ` collecting optimized out variables regression (Re: RFA: rewrite dwarf->ax translator Tom Tromey
2010-07-01 15:57 ` Pedro Alves
2010-07-01 15:34 ` collecting optimized out variables regression (Re: RFA: rewrite dwarf->ax translator (Was: RFC: implement DW_OP_bit_piece)) Jan Kratochvil
2010-05-20 19:53 ` RFC: implement DW_OP_bit_piece Tom Tromey
2010-05-20 20:30 ` Jan Kratochvil
2010-05-21 20:16 ` Tom Tromey
2010-05-21 21:16 ` Stan Shebs
2010-05-21 21:18 ` Tom Tromey
2010-05-25 19:22 ` RFC: DWARF expression disassembly (Was: RFC: implement DW_OP_bit_piece) Tom Tromey
2010-05-25 19:27 ` Jan Kratochvil
2010-05-25 20:25 ` RFC: DWARF expression disassembly Tom Tromey
2010-05-25 20:52 ` Jan Kratochvil
2010-05-25 22:03 ` Tom Tromey
2010-05-26 17:21 ` Eli Zaretskii
2010-06-01 18:36 ` Tom Tromey
2010-06-01 18:40 ` Eli Zaretskii
2010-06-02 19:32 ` Tom Tromey
2010-05-20 21:07 ` RFC: implement DW_OP_bit_piece Jan Kratochvil
2010-05-21 17:57 ` Tom Tromey
2010-05-25 18:19 ` performance talk [Re: RFC: implement DW_OP_bit_piece] Jan Kratochvil
2010-05-25 22:23 ` Tom Tromey [this message]
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=m3bpc3prk1.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/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