public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/18389] New: gcc5 code folding breaks tracepoint queries
@ 2015-05-08 19:49 jistone at redhat dot com
  2015-05-08 19:50 ` [Bug translator/18389] " jistone at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: jistone at redhat dot com @ 2015-05-08 19:49 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 18389
           Summary: gcc5 code folding breaks tracepoint queries
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: jistone at redhat dot com
  Target Milestone: ---

GCC5 now has Identical Code Folding, -fipa-icf, and it's enabled by default at
-O2 or higher.

SystemTap's tracepoint queries use stub functions like:
  void stapprobe_##name(proto) {}

When multiple tracepoint's proto is the same in a given object, GCC5 is merging
them, so we only find one of them in debuginfo.

For instance, sys_enter takes (struct pt_regs *regs, long id), and sys_exit
takes (struct pt_regs *regs, long reg).  These are identical as far as gcc is
concerned, so they're merged.  So stap -l 'kernel.trace("sys_*")' only shows me
sys_exit.

The "winner" may not be deterministic, but for now it appears to be the last
one declared.  Another example is that there are 8 "ext4_*" tracepoints which
take just (struct inode *inode), and only ext4_load_inode shows up in stap.

Adding -fno-ipa-icf will disable this, if we can do that in a compatible way.

Another possibility is to force uniqueness, perhaps something like:
  int stapprobe_##name(proto) {
    static int i = 0;
    return ++i;
  }

(The tracepoint query objects are never linked or executed, so the function
body is irrelevant as long as they all show up in debuginfo.)

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug translator/18389] gcc5 code folding breaks tracepoint queries
  2015-05-08 19:49 [Bug translator/18389] New: gcc5 code folding breaks tracepoint queries jistone at redhat dot com
@ 2015-05-08 19:50 ` jistone at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: jistone at redhat dot com @ 2015-05-08 19:50 UTC (permalink / raw)
  To: systemtap

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

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|systemtap at sourceware dot org    |jistone at redhat dot com

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-08 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-08 19:49 [Bug translator/18389] New: gcc5 code folding breaks tracepoint queries jistone at redhat dot com
2015-05-08 19:50 ` [Bug translator/18389] " jistone at redhat dot com

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).