From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id B79DA3858C35 for ; Mon, 27 Nov 2023 15:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B79DA3858C35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B79DA3858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701099094; cv=none; b=H1BCCpa41GK4FhSFP23w52zGgMCz2nw+5TWcx3Kb1HnfUYrwR3CkESw3lFfRtgoogr6GZ3AVPkztMa8k2UANFAtM0RM7cXejgRoXMf4xs2B/S08bWErhfz2UStUyBMGXr0zCkDoC/U7gMmHL6u+TEgeig22E6Q1/bfjHKpcPpaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701099094; c=relaxed/simple; bh=28JuN3pgPhE5pZ5yScfOOlMCg1fD8YuTI+VOlDJlAmE=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=buaUMHyS1DnIUhLxk+JNCFB7IcW66vT7INBefPyzlDKf457jcOMbpVk444HD/v7C/Fhk4DnsG8sj+86Ok1SCxSiCauSmejC5pYEz/DmYJsf/hz5XknFfNlv53O3BbDlVh7vIU6bGedOs3CR9S//tf1DRuTemzluZBl+Rkm844II= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 169921FD6F; Mon, 27 Nov 2023 15:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701099088; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=97YC67e5T0NjsLDz9OHXaFQ0ZvvanExHjE8v99efIQ8=; b=wKDBpHmyofRjhoa56//r854IHLCmOmjIhPJ7Y5OvKlmg90w8L9wmk4p/Smasp3aDH+PJRk 4dlrjribzk/cNxzAG0qZgu3ZhMGbULkuEiaJFtHKWv4GL0a0z3bO08l1+5YghL2Y76FuEq vsX6FgO4Es8tejJPucWUcwcmLXluzTs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701099088; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=97YC67e5T0NjsLDz9OHXaFQ0ZvvanExHjE8v99efIQ8=; b=66mwuzwaHQJKp72NUk3UXJCWG85kUDinim9fVGuYBA/tpTmfsHLoikk9n1E88vh/Gv8iUF LD/YQL7FxianJeBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id ED8BF1367B; Mon, 27 Nov 2023 15:31:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 3IZQOE+2ZGXyRQAAD6G6ig (envelope-from ); Mon, 27 Nov 2023 15:31:27 +0000 Message-ID: Date: Mon, 27 Nov 2023 16:31:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 00/18] Index DWARF in the background Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20231122-t-bg-dwarf-reading-v3-0-fc3180de63c4@tromey.com> From: Tom de Vries In-Reply-To: <20231122-t-bg-dwarf-reading-v3-0-fc3180de63c4@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-0.999]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[sourceware.org:url]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: -4.29 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/23/23 06:32, Tom Tromey wrote: > This series changes gdb to do its initial DWARF indexing in the > background. > > This process is mostly asynchronous with respect to the rest of gdb. > That is, rather than pre-emptively waiting for scanning to complete, > now gdb's main thread will only wait when some result of the scan is > required. > > This drastically improves gdb's apparent startup time in the "normal" > case where a user does "gdb some-executable" -- e.g., for starting gdb > on itself, the time until the prompt returns goes from ~1.2 seconds to > ~0.06 seconds on my machine. > > This approach works by hiding most of the work from the user. Waiting > can still be needed; for example if one starts gdb and immediately > sets a breakpoint -- however, because the indexer is reasonably fast, > and human reaction times are slow, this series still manages to be > fairly successful. > > My current belief is that doing any better than this will probably > require a new debug format that isn't quite so cursed to read. > > I regression tested this on x86-64 Fedora 38. I've also built it with > TSAN and tested that, though TSAN seems to introduce random timeouts > into the testsuite when I use "make -j8 check". > I've tested the series with target boards: - unix - cc-with-dwz - cc-with-index-cache and found no new issues. I've also test-driven it a bit, indeed it makes gdb feel more responsive, I think it's a nice improvement. Thanks, - Tom > --- > Changes in v3: > - Rebase on top of the C++17 changes > - Apply Tom de Vries' bug fix > - Fix a "save gdb-index" bug found by Alexandra > - Link to v2: https://inbox.sourceware.org/gdb-patches/20231112-t-bg-dwarf-reading-v2-0-70fb170012ba@tromey.com > > Changes in v2: > - Updated to final style of BFD locking > - Added a thread safety fix for DWO > - Added a patch to pre-read DWZ sections > - Added calls to bfd_thread_cleanup and bfd_cache_close > - Link to v1: https://inbox.sourceware.org/gdb-patches/20231029173839.471514-1-tom@tromey.com > > --- > Tom Tromey (18): > Don't use objfile::intern in DWO code > Pre-read DWZ section data > Add a couple of bfd_cache_close calls > Add thread-safety to gdb's BFD wrappers > Refactor complaint thread-safety approach > Add quick_symbol_functions::compute_main_name > Add gdb::task_group > Move cooked_index_storage to cooked-index.h > Add "maint set dwarf synchronous" > Change how cooked index waits for threads > Do more DWARF reading in the background > Simplify the public DWARF API > Remove two quick_symbol_functions methods > Change current_language to be a macro > Lazy language setting > Optimize lookup_minimal_symbol_text > Avoid language-based lookups in startup path > Back out some parallel_for_each features > > gdb/NEWS | 4 + > gdb/breakpoint.c | 4 +- > gdb/coffread.c | 6 +- > gdb/complaints.c | 24 +- > gdb/complaints.h | 37 +- > gdb/defs.h | 2 +- > gdb/doc/gdb.texinfo | 18 + > gdb/dwarf2/cooked-index.c | 201 ++++--- > gdb/dwarf2/cooked-index.h | 316 ++++++++-- > gdb/dwarf2/dwz.c | 90 ++- > gdb/dwarf2/dwz.h | 13 +- > gdb/dwarf2/macro.c | 2 - > gdb/dwarf2/public.h | 18 +- > gdb/dwarf2/read.c | 729 +++++++++++++---------- > gdb/dwarf2/read.h | 2 +- > gdb/elfread.c | 6 +- > gdb/gdb_bfd.c | 58 ++ > gdb/gdb_bfd.h | 5 + > gdb/gdbthread.h | 3 +- > gdb/jit.c | 4 +- > gdb/language.c | 51 +- > gdb/language.h | 34 +- > gdb/machoread.c | 11 +- > gdb/main.c | 3 +- > gdb/minsyms.c | 69 ++- > gdb/objfile-flags.h | 4 - > gdb/objfiles.h | 17 +- > gdb/psymtab.c | 1 - > gdb/quick-symbol.h | 17 +- > gdb/symfile-debug.c | 77 +-- > gdb/symfile.c | 22 +- > gdb/symtab.c | 2 + > gdb/testsuite/gdb.dwarf2/dw2-error.exp | 1 + > gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp | 2 + > gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp | 2 + > gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp | 2 + > gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp | 4 +- > gdb/testsuite/gdb.dwarf2/fission-reread.exp | 5 +- > gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp | 1 + > gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp | 10 +- > gdb/thread.c | 8 +- > gdb/top.c | 2 +- > gdb/unittests/parallel-for-selftests.c | 47 -- > gdb/xcoffread.c | 3 +- > gdbsupport/Makefile.am | 1 + > gdbsupport/Makefile.in | 6 +- > gdbsupport/parallel-for.h | 234 +------- > gdbsupport/task-group.cc | 97 +++ > gdbsupport/task-group.h | 64 ++ > 49 files changed, 1409 insertions(+), 930 deletions(-) > --- > base-commit: a54a99a6e5159e4406e172f074b3729b2135c28c > change-id: 20231112-t-bg-dwarf-reading-00b65fa130b3 > > Best regards,