From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82687 invoked by alias); 13 Feb 2020 15:40:11 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 82652 invoked by uid 48); 13 Feb 2020 15:40:07 -0000 From: "wcohen at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/25549] New: Systemtap unable to find many probe points available in code compiled with LTO enable Date: Thu, 13 Feb 2020 15:40:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcohen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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-SW-Source: 2020-q1/txt/msg00016.txt https://sourceware.org/bugzilla/show_bug.cgi?id=3D25549 Bug ID: 25549 Summary: Systemtap unable to find many probe points available in code compiled with LTO enable Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: translator Assignee: systemtap at sourceware dot org Reporter: wcohen at redhat dot com Target Milestone: --- When researching the quality of debuginfo generated by compilers with vario= us options I found that that systemtap -l returned an inordinately few number = of probe points for the code compiled with gcc and LTO enabled (https://github.com/wcohen/quality_info/blob/master/bin/gen_rpm_variants): $ stap -v -L 'process("./binutils-2.31.1-29.fc30_gcc_o2_lto_g_.x86_64/usr/bin/ld").state= ment("*@*:*")' |wc Pass 1: parsed user script and 575 library scripts using 1253792virt/1024272res/13080shr/1011084data kb, in 2340usr/250sys/2639real = ms. Pass 2: analyzed script: 1196 probes, 0 functions, 0 embeds, 0 globals using 1644104virt/1411320res/14128shr/1401396data kb, in 8030usr/120sys/8246real = ms. 1196 16473 419224 This is compared to the ~250K for the default compile options: $ stap -v -L 'process("./binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld").statemen= t("*@*:*")' |wc Pass 1: parsed user script and 575 library scripts using 1253792virt/1024476res/13280shr/1011084data kb, in 2380usr/240sys/2636real = ms. Pass 2: analyzed script: 249528 probes, 0 functions, 0 embeds, 0 globals us= ing 1919176virt/1689856res/14280shr/1676468data kb, in 112090usr/11990sys/124827real ms. 249528 3799250 94003914 There does seem to be a significant amount of line info in the lto=20 $ eu-readelf -S binutils-2.31.1-29.fc30_gcc_o2_lto_g_.x86_64/usr/bin/.debug/ld-2.31.1-29.fc= 30_gcc_o2_lto_g_.x86_64.debug=20 There are 39 section headers, starting at offset 0x3ba54a8: ... [31] .debug_line PROGBITS 0000000000000000 02130bd7 001ab9ee = 0=20=20=20 0 0 1 When comparted to the non-lto version: $ eu-readelf -S binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/.debug/ld-2.31.1-29.fc30_= gcc_o2__g_.x86_64.debug=20 There are 42 section headers, starting at offset 0x34b57f0: ... [33] .debug_line PROGBITS 0000000000000000 01a50f48 0025a74e = 0=20=20=20 0 0 1 readelf can decode the line information and show there is a lot of lines available in both versions: [wcohen@cervelo BUILDROOT]$ readelf -wLK ./binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld|wc 801150 1923252 41456606 [wcohen@cervelo BUILDROOT]$ readelf -wLK ./binutils-2.31.1-29.fc30_gcc_o2_lto_g_.x86_64/usr/bin/ld|wc 566402 1363476 29302199 gdb allows setting a breakpoint on main.cc:139 on both LTO and non-LTO versions. However, systemtap does not see any of the lines for main in the= lto version: [wcohen@cervelo BUILDROOT]$ stap -l 'process("./binutils-2.31.1-29.fc30_gcc_o2_lto_g_.x86_64/usr/bin/ld").state= ment("main@*:*")'|wc 0 0 0 [wcohen@cervelo BUILDROOT]$ stap -l 'process("./binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld").statemen= t("main@*:*")'|wc 97 97 18236 How to reproduce: wget https://kojipkgs.fedoraproject.org//packages/binutils/2.31.1/29.fc30/src/bi= nutils-2.31.1-29.fc30.src.rpm sudo yum builddep binutils-2.31.1-29.fc30.src.rpm -y rpm -Uvh binutils-2.31.1-29.fc30.src.rpm cd ~/rpmbuild/SPECS wget https://raw.githubusercontent.com/wcohen/quality_info/systemtap_lto/bin/gen= _rpm_variants ./gen_rpm_variants binutils.spec /usr/bin/ld Wait a while while the variants are built. Once done should have the varia= nts in ~/rpmbuild/BUILDROOT to further investigate the issue. --=20 You are receiving this mail because: You are the assignee for the bug.