From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F151385383B; Wed, 12 May 2021 20:37:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F151385383B From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug macros/27754] Excessive CPU load and memory usage with -g3 debug info Date: Wed, 12 May 2021 20:37:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: macros X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2021 20:37:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27754 Simon Marchi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simark at simark dot ca --- Comment #13 from Simon Marchi --- I am encountering something similar, although I don't use LTO. My symptom is that when I do "thread apply all bt", there's a noticeable pa= use of 2-3 seconds between each thread. I added a bit of logging, that time is spent expanding a single CU. I profiled, and all that time is spent in dwarf_decode_macros. I'll attach a binary (lt-lttng-sessiond). I am experimenting with: $ ./gdb --data-directory=3Ddata-directory -nx /home/simark/build/lttng-tools-noasan/src/bin/lttng-sessiond/.libs/lt-lttng= -sessiond -ex "maint expand register.c" -batch Which expands the CU at 0x6a1c9. That reads the macros at 0x2919d in .debug_macro. Here are the first few lines: DW_MACRO_import - offset : 0x0 DW_MACRO_start_file - lineno: 0 filenum: 9 filename: /home/simark/src/lttng-tools/src/bin/lttng-sessiond/register.c DW_MACRO_start_file - lineno: 0 filenum: 41 filename: /usr/include/stdc-predef.h DW_MACRO_import - offset : 0x0 DW_MACRO_end_file DW_MACRO_start_file - lineno: 0 filenum: 42 filename: ../../../include/config.h DW_MACRO_import - offset : 0x0 DW_MACRO_end_file DW_MACRO_start_file - lineno: 10 filenum: 10 filename: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/stddef.h DW_MACRO_import - offset : 0x0 DW_MACRO_end_file DW_MACRO_start_file - lineno: 11 filenum: 43 filename: /usr/include/stdlib= .h DW_MACRO_define_strp - lineno : 24 macro : __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION=20 DW_MACRO_start_file - lineno: 25 filenum: 44 filename: /usr/include/bits/libc-header-start.h DW_MACRO_undef_strp - lineno : 31 macro : __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION DW_MACRO_start_file - lineno: 33 filenum: 45 filename: /usr/include/featur= es.h DW_MACRO_import - offset : 0x0 DW_MACRO_start_file - lineno: 473 filenum: 46 filename: /usr/include/sys/cdefs.h DW_MACRO_import - offset : 0x0 DW_MACRO_start_file - lineno: 462 filenum: 47 filename: /usr/include/bits/wordsize.h DW_MACRO_import - offset : 0x0 DW_MACRO_end_file DW_MACRO_start_file - lineno: 463 filenum: 48 filename: /usr/include/bits/long-double.h ... The imports at offset 0 look wrong. First, there are a ton of them, one at pretty much every included file. But also because the macro informations at offset 0 in .debug_macro are those of a totally unrelated CU. When I check the relocations in the corresponding .o, I do see: Relocation section '.rela.debug_macro' at offset 0x25cb0 contains 412 entri= es: Offset Info Type Symbol's Value=20 Symbol's Name + Addend 0000000000000003 0000002b0000000a R_X86_64_32 0000000000000000 .debug_line + 0 0000000000000008 0000002d0000000a R_X86_64_32 0000000000000000 .debug_macro + 0 0000000000000013 0000002e0000000a R_X86_64_32 0000000000000000 .debug_macro + 0 000000000000001c 0000002f0000000a R_X86_64_32 0000000000000000 .debug_macro + 0 0000000000000025 000000300000000a R_X86_64_32 0000000000000000 .debug_macro + 0 So the relocations are really asking for ".debug_macro + 0". --=20 You are receiving this mail because: You are on the CC list for the bug.=