From: "wcohen at redhat dot com" <sourceware-bugzilla@sourceware.org>
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 [thread overview]
Message-ID: <bug-25549-6586@http.sourceware.org/bugzilla/> (raw)
https://sourceware.org/bugzilla/show_bug.cgi?id=25549
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 various
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").statement("*@*:*")'
|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").statement("*@*:*")'
|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 using
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
$ eu-readelf -S
binutils-2.31.1-29.fc30_gcc_o2_lto_g_.x86_64/usr/bin/.debug/ld-2.31.1-29.fc30_gcc_o2_lto_g_.x86_64.debug
There are 39 section headers, starting at offset 0x3ba54a8:
...
[31] .debug_line PROGBITS 0000000000000000 02130bd7 001ab9ee 0
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
There are 42 section headers, starting at offset 0x34b57f0:
...
[33] .debug_line PROGBITS 0000000000000000 01a50f48 0025a74e 0
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").statement("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").statement("main@*:*")'|wc
97 97 18236
How to reproduce:
wget
https://kojipkgs.fedoraproject.org//packages/binutils/2.31.1/29.fc30/src/binutils-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 variants
in ~/rpmbuild/BUILDROOT to further investigate the issue.
--
You are receiving this mail because:
You are the assignee for the bug.
next reply other threads:[~2020-02-13 15:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 15:40 wcohen at redhat dot com [this message]
2020-05-01 18:31 ` [Bug translator/25549] " wcohen at redhat dot com
2020-05-04 20:18 ` wcohen at redhat dot com
2020-05-05 15:41 ` wcohen at redhat dot com
2020-05-05 20:49 ` woodard at redhat dot com
2020-05-07 2:06 ` fche at redhat dot com
2020-05-07 3:26 ` mark at klomp dot org
2020-05-07 10:27 ` fche at redhat dot com
2020-05-07 10:28 ` fche at redhat dot com
2020-05-07 11:36 ` mark at klomp dot org
2020-05-07 13:58 ` wcohen at redhat dot com
2020-05-07 17:55 ` wcohen at redhat dot com
2020-05-08 10:15 ` mark at klomp dot org
2020-05-08 14:02 ` wcohen at redhat dot com
2020-05-08 17:25 ` mark at klomp dot org
2020-05-08 20:07 ` wcohen at redhat dot com
2020-07-10 3:00 ` fche at redhat dot com
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-25549-6586@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=systemtap@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).