This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/25549] New: Systemtap unable to find many probe points available in code compiled with LTO enable


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]