public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simon.marchi at polymtl dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/29105] new DWARF reader still slow
Date: Wed, 18 May 2022 16:12:14 +0000	[thread overview]
Message-ID: <bug-29105-4717-QcqhyfRZL2@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29105-4717@http.sourceware.org/bugzilla/>

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at polymtl dot ca

--- Comment #4 from Simon Marchi <simon.marchi at polymtl dot ca> ---
Hi Tom,

I'm not sure why I am starting to see this only today, but I see a lot of tests
timing out.  gdb.base/sizeof.exp is one of them.  It looks like it's due to a
slowdown that started with the new DWARF reader patches.

My build uses -O0 and all the sanitizer and glibcxx debug stuff, so it doesn't
help, but I see the same relative slowdown without that.

I copied the test program of gdb.base/sizeof.exp to /tmp/sizeof so it could be
reused easily across builds.

The command I use is:

  time ./gdb -q --data-directory=data-directory -nx /tmp/sizeof -ex "start" 
-iex "set debug dwarf-read 0" -ex "p/d sizeof(short)" -batch

This replicates the first steps of the test.

Using 3d20b8d99a5:
./gdb -q --data-directory=data-directory -nx /tmp/sizeof -ex "start" -ex  -e 
1.18s user 0.17s system 116% cpu 1.157 total

Using 3d20b8d99a5^:
./gdb -q --data-directory=data-directory -nx /tmp/sizeof -ex "start" -ex  -e 
0.40s user 0.07s system 109% cpu 0.427 total

By toggling "set debug dwarf-read" to 1, I noticed that we are now expanding a
lot of CUs from libc's debug info when doing the "print sizeof":

[dwarf-read] process_queue: Expanding one or more symtabs of objfile
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so ...
[dwarf-read] process_queue: Expanding symtab of CU at offset 0xd3cbe
[dwarf-read] process_queue: Done expanding CU at offset 0xd3cbe
[dwarf-read] process_queue: Done expanding symtabs of
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so.
[dwarf-read] process_queue: Expanding one or more symtabs of objfile
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so ...
[dwarf-read] process_queue: Expanding symtab of CU at offset 0x22bf6f
[dwarf-read] process_queue: Done expanding CU at offset 0x22bf6f
[dwarf-read] process_queue: Done expanding symtabs of
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so.
[dwarf-read] process_queue: Expanding one or more symtabs of objfile
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so ...
[dwarf-read] process_queue: Expanding symtab of CU at offset 0x7ef56e
[dwarf-read] process_queue: Done expanding CU at offset 0x7ef56e
[dwarf-read] process_queue: Done expanding symtabs of
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so.
...

We expand ~1500 CUs.

Before, we didn't do that.  So having debug info for libc is important for
reproducing this, and a GDB configured with --prefix/usr or some other switch
that makes it find separate debug info in /usr/lib/debug (by default a local
build would look in /usr/local/lib/debug).  I am reproducing this on Ubuntu
20.04.

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

  parent reply	other threads:[~2022-05-18 16:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 19:51 [Bug symtab/29105] New: " tromey at sourceware dot org
2022-04-29 20:09 ` [Bug symtab/29105] " tromey at sourceware dot org
2022-05-13 20:56 ` tromey at sourceware dot org
2022-05-13 21:01 ` tromey at sourceware dot org
2022-05-16 18:51 ` tromey at sourceware dot org
2022-05-18 16:12 ` simon.marchi at polymtl dot ca [this message]
2022-05-20  1:54 ` simark at simark dot ca
2022-05-20 15:13 ` tromey at sourceware dot org
2022-05-20 15:36 ` simon.marchi at polymtl dot ca
2022-05-20 15:48 ` simon.marchi at polymtl dot ca
2022-05-26 13:49 ` cvs-commit at gcc dot gnu.org
2022-05-26 13:50 ` tromey at sourceware dot org
2022-07-13 16:49 ` tromey at sourceware dot org
2022-09-23 20:23 ` tromey at sourceware dot org
2022-09-23 20:44 ` tromey at sourceware dot org
2022-10-02  0:19 ` brobecker at gnat dot com
2022-10-06 20:44 ` tromey at sourceware dot org
2022-10-24 19:27 ` simon.marchi at polymtl dot ca
2022-11-01 20:42 ` tromey at sourceware dot org
2022-11-04 20:05 ` tromey at sourceware dot org
2022-11-04 20:10 ` simon.marchi at polymtl dot ca
2022-11-04 21:27 ` tromey at sourceware dot org
2022-11-04 21:28 ` tromey at sourceware dot org
2022-11-04 21:28 ` tromey at sourceware dot org
2022-11-05  1:28 ` simark at simark dot ca
2022-11-07 16:28 ` tromey at sourceware dot org
2022-11-16  0:09 ` tkacvins at gmail dot com
2022-11-16  0:56 ` simark at simark dot ca
2022-11-16 15:07 ` tkacvins at gmail dot com
2022-12-01 16:44 ` cvs-commit at gcc dot gnu.org
2022-12-01 18:18 ` cvs-commit at gcc dot gnu.org
2022-12-01 18:22 ` tromey at sourceware dot org
2022-12-14 10:23 ` cvs-commit at gcc dot gnu.org

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=bug-29105-4717-QcqhyfRZL2@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).