public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "wcohen at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/25549] Systemtap unable to find many probe points available in code compiled with LTO enable
Date: Fri, 08 May 2020 20:07:06 +0000	[thread overview]
Message-ID: <bug-25549-6586-hyRgyzB3DZ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25549-6586@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25549

--- Comment #13 from William Cohen <wcohen at redhat dot com> ---
It took a bit longer to build similar binaries. binutils-2.31 doesn't compile
on f32, Used binutils-2.34-2.fc32.src.rpm on f32 with
gcc-10.0.1-0.14.fc32.x86_64

built the regular default binutil with:

rpmbuild -ba binutils.spec

The lto enabled one with

rpmbuild --define "%optflags -flto -ffat-lto-objects -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-fexceptions -fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection"  -bi
binutils.spec

The ld binary is ld-new in the build.  They have been placed in:

http://people.redhat.com/wcohen/pr25549/binutils-2.34.base/gold/ld-new
http://people.redhat.com/wcohen/pr25549/binutils-2.34.lto/gold/ld-new

The results similar for these binaries to the earlier results with the patched
elfutils being used:

[wcohen@fedora32 BUILD]$ stap -v -L
'process("./binutils-2.34.lto/gold/ld-new").statement("*@*:*")' |wc
Pass 1: parsed user script and 502 library scripts using
442596virt/212504res/13092shr/199240data kb, in 470usr/110sys/582real ms.
Pass 2: analyzed script: 19429 probes, 0 functions, 0 embeds, 0 globals using
540720virt/308324res/14024shr/297364data kb, in 6690usr/180sys/7011real ms.
  19429  454247 8913840
[wcohen@fedora32 BUILD]$ stap -v -L
'process("./binutils-2.34.base/gold/ld-new").statement("*@*:*")' |wc
Pass 1: parsed user script and 502 library scripts using
442596virt/212048res/12636shr/199240data kb, in 470usr/60sys/532real ms.
Pass 2: analyzed script: 257942 probes, 0 functions, 0 embeds, 0 globals using
1068956virt/838748res/13376shr/825600data kb, in 90030usr/10680sys/103013real
ms.
 257942 3926369 88009445

Part of the issue with the file might be due to the file names being
mis-attributed in systemtap. I saw that in a number of places with the
binutils-2.31 I was analyzing earliers.  When comparing probe points for
main.cc I noticed that there were a number of lines way pass the end of the 332
line main.cc file.  The "-v -L" option includes a PC location so I was able to
find various references to the same instruction:

$ grep 3e9ec a
process("/home/wcohen/rpmbuild/BUILDROOT/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld").statement("main@/usr/src/debug/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/gold/main.cc:1445")
/* pc=.dynamic+0x3e9ec */ $args:string $errors:class Errors $command_line:class
Command_line $timer:class Timer $mapfile:class Mapfile* $workqueue:class
Workqueue $input_objects:class Input_objects $gc:class Garbage_collection
$icf:class Icf $symtab:class Symbol_table $layout:class Layout
$search_path:class Dirsearch
process("/home/wcohen/rpmbuild/BUILDROOT/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld").statement("main@/usr/src/debug/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/gold/main.cc:223")
/* pc=.dynamic+0x3e9ec */ $args:string $errors:class Errors $command_line:class
Command_line $timer:class Timer $mapfile:class Mapfile* $workqueue:class
Workqueue $input_objects:class Input_objects $gc:class Garbage_collection
$icf:class Icf $symtab:class Symbol_table $layout:class Layout
$search_path:class Dirsearch
process("/home/wcohen/rpmbuild/BUILDROOT/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld").statement("set_gc@/usr/src/debug/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/gold/symtab.h:1445")
/* pc=.dynamic+0x3e9ec */ $this:class Symbol_table* const $gc:class
Garbage_collection*
process("/home/wcohen/rpmbuild/BUILDROOT/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/usr/bin/ld").statement("set_gc@/usr/src/debug/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/gold/symtab.h:223")
/* pc=.dynamic+0x3e9ec */ $this:class Symbol_table* const $gc:class
Garbage_collection*

Looking through the readelf --dump-debug=decodedline output it appears that
readelf gets something reasonable:

Looking at the output of readelf for above it look like uses first file name
with
view from last line number:
./main.cc:[++]
main.cc                                      222             0x3e9e3       3
main.cc                                      223             0x3e9ec

./symtab.h:[++]
symtab.h                                    1444             0x3e9ec       1
symtab.h                                    1445             0x3e9ec       2
symtab.h                                    1445             0x3e9ec       3

eu-readelf also looks reasonable:

  /usr/src/debug/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/gold/main.cc (mtime:
0, length: 0)
   222:3            0   0  0 +0x000000000003e9e3 <main+0x4a3>
   223:5   S        0   0  0 +0x000000000003e9ec <main+0x4ac>
  /usr/src/debug/binutils-2.31.1-29.fc30_gcc_o2__g_.x86_64/gold/symtab.h
(mtime: 0, length: 0)
  1444:3   S        0   0  0 +0x000000000003e9ec <main+0x4ac>
  1445:5   S        0   0  0 +0x000000000003e9ec <main+0x4ac>
  1445:15           0   0  0 +0x000000000003e9ec <main+0x4ac>

-- 
You are receiving this mail because:
You are the assignee for the bug.

  parent reply	other threads:[~2020-05-08 20:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 15:40 [Bug translator/25549] New: " wcohen at redhat dot com
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 [this message]
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-hyRgyzB3DZ@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).