* parallel loading of debug info in gdb @ 2025-01-07 2:14 Yubin via Gdb 2025-01-07 11:07 ` Luis Machado via Gdb 0 siblings, 1 reply; 6+ messages in thread From: Yubin via Gdb @ 2025-01-07 2:14 UTC (permalink / raw) To: gdb Hi, Does gdb supports parallel loading of debug symbols? I am debugging some binary which is 3~4GB itself, and loading and parsing its debug info takes minutes. Thanks, Yubin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: parallel loading of debug info in gdb 2025-01-07 2:14 parallel loading of debug info in gdb Yubin via Gdb @ 2025-01-07 11:07 ` Luis Machado via Gdb 2025-01-07 11:33 ` Yubin via Gdb 0 siblings, 1 reply; 6+ messages in thread From: Luis Machado via Gdb @ 2025-01-07 11:07 UTC (permalink / raw) To: Yubin, gdb; +Cc: Tom Tromey On 1/7/25 02:14, Yubin via Gdb wrote: > Hi, > > Does gdb supports parallel loading of debug symbols? I am debugging some > binary which is 3~4GB itself, and loading and parsing its debug info takes > minutes. Since a few years, gdb has had worker threads, potentially as many as cores (physical or virtual) on the system. So it does support trying to read things in parallel. Unfortunately the nature of the data limits things somewhat, as you have dependencies and have to look those up before proceeding further. I've cc-ed Tromey, which worked in this area before. > > Thanks, > Yubin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: parallel loading of debug info in gdb 2025-01-07 11:07 ` Luis Machado via Gdb @ 2025-01-07 11:33 ` Yubin via Gdb 2025-01-07 23:45 ` Tom Tromey 0 siblings, 1 reply; 6+ messages in thread From: Yubin via Gdb @ 2025-01-07 11:33 UTC (permalink / raw) To: Luis Machado; +Cc: gdb, Tom Tromey On Tue, Jan 7, 2025 at 7:08 PM Luis Machado <luis.machado@arm.com> wrote: > On 1/7/25 02:14, Yubin via Gdb wrote: > > Hi, > > > > Does gdb supports parallel loading of debug symbols? I am debugging some > > binary which is 3~4GB itself, and loading and parsing its debug info > takes > > minutes. > > Since a few years, gdb has had worker threads, potentially as many as cores > (physical or virtual) on the system. > > So it does support trying to read things in parallel. Unfortunately the > nature of the data limits things somewhat, as you have dependencies and > have > to look those up before proceeding further. > Yes dependency is a problem, but some dependent libs are naturally independent to be read by parallel. If there could be some way to specify this, it would be great. > I've cc-ed Tromey, which worked in this area before. > Thanks. Yubin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: parallel loading of debug info in gdb 2025-01-07 11:33 ` Yubin via Gdb @ 2025-01-07 23:45 ` Tom Tromey 2025-01-08 15:40 ` Yubin via Gdb 0 siblings, 1 reply; 6+ messages in thread From: Tom Tromey @ 2025-01-07 23:45 UTC (permalink / raw) To: Yubin; +Cc: Luis Machado, gdb, Tom Tromey > Yes dependency is a problem, but some dependent libs are naturally > independent to be read by parallel. If there could be some way to > specify this, it would be great. If you try git gdb, you can enable background reading with "maint set dwarf synchronous off". (There's been at least one request to re-enable this by default for GDB 16... I wasn't sure if we should, though, considering that the data race fixes are pretty new.) Anyway, background reading is lazier -- the reading is started but gdb will only pause for it if it is truly needed. Note that the library debug info isn't really read in parallel. Or, it kind of is, depending on how the scheduling shakes out. That is, the DWARF reader looks at the number of worker threads and splits its work up accordingly. "Overlap" can only really happen if one such worker finishes and then the next library's job is scheduled. This might be a bad strategy overall. Like, testing on a big machine showed that the reader didn't parallelize past 8 CPUs, so maybe it would be better to limit the DWARF reader to 8 tasks. Nobody has worked on figuring out why it doesn't scale better, though, and I wouldn't want to change this without knowing more. Tom ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: parallel loading of debug info in gdb 2025-01-07 23:45 ` Tom Tromey @ 2025-01-08 15:40 ` Yubin via Gdb 2025-01-09 0:26 ` Tom Tromey 0 siblings, 1 reply; 6+ messages in thread From: Yubin via Gdb @ 2025-01-08 15:40 UTC (permalink / raw) To: Tom Tromey; +Cc: Luis Machado, gdb On Wed, Jan 8, 2025 at 7:45 AM Tom Tromey <tom@tromey.com> wrote: > > Yes dependency is a problem, but some dependent libs are naturally > > independent to be read by parallel. If there could be some way to > > specify this, it would be great. > > If you try git gdb, you can enable background reading with > "maint set dwarf synchronous off". > Thanks, using this command in gdb15.2 indeed make the initial loading faster. > > (There's been at least one request to re-enable this by default for GDB > 16... I wasn't sure if we should, though, considering that the data race > fixes are pretty new.) > > Anyway, background reading is lazier -- the reading is started but gdb > will only pause for it if it is truly needed. > > Note that the library debug info isn't really read in parallel. Or, it > kind of is, depending on how the scheduling shakes out. That is, the > DWARF reader looks at the number of worker threads and splits its work > up accordingly. "Overlap" can only really happen if one such worker > finishes and then the next library's job is scheduled. > > This might be a bad strategy overall. Like, testing on a big machine > showed that the reader didn't parallelize past 8 CPUs, so maybe it would > be better to limit the DWARF reader to 8 tasks. Nobody has worked on > figuring out why it doesn't scale better, though, and I wouldn't want to > change this without knowing more. > > Tom > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: parallel loading of debug info in gdb 2025-01-08 15:40 ` Yubin via Gdb @ 2025-01-09 0:26 ` Tom Tromey 0 siblings, 0 replies; 6+ messages in thread From: Tom Tromey @ 2025-01-09 0:26 UTC (permalink / raw) To: Yubin; +Cc: Tom Tromey, Luis Machado, gdb > Thanks, using this command in gdb15.2 indeed make the initial loading faster. Just beware that in 15.2 there are some known data races, which is why it is off by default. I don't know whether those races can actually cause problems. Tom ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-01-09 0:27 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-01-07 2:14 parallel loading of debug info in gdb Yubin via Gdb 2025-01-07 11:07 ` Luis Machado via Gdb 2025-01-07 11:33 ` Yubin via Gdb 2025-01-07 23:45 ` Tom Tromey 2025-01-08 15:40 ` Yubin via Gdb 2025-01-09 0:26 ` Tom Tromey
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox