public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/10512] New: STAP_PROBES don't work in c++ constructors/destructors
@ 2009-08-12 14:58 mjw at redhat dot com
  2009-08-12 15:00 ` [Bug runtime/10512] " mjw at redhat dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: mjw at redhat dot com @ 2009-08-12 14:58 UTC (permalink / raw)
  To: systemtap

The problem is that the current way the STAP_PROBE macros are defined in sdt.h
doesn't work nicely with COMDAT sections. The linker might throw away the COMDAT
section that contains the code g++ generates for the class
constructors/destructors that our .probes section refers to.

There is no easy way to figure out whether the current code section is in a
COMDAT group or not when using a gas .section pseudo-op.

But if we would define the data section as a C static variable with an
__attribute__ ((section (".probes"))) is seems gcc inherits the COMDATness of
the current code section.

Currently the labels used for identifying the probe points are defined inside
the asm statements. Roland suggested using something like an extern void label
asm (".Llabelname") to reuse them on the C side. The STAP_PROBE_DATA could then
be expressed like:

  static const struct                                                   \
    {                                                                   \
      int guard __attribute__((__aligned__(4)));                        \
      void *probe_addr __attribute__((__aligned__(8)));                 \
      void *name_addr __attribute__((__aligned__(8)));                  \
    } probe __attribute__((__aligned__(8)), (section (".probes")))      \
    = {guard, &label, #name}

-- 
           Summary: STAP_PROBES don't work in c++ constructors/destructors
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: mjw at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10512

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

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

end of thread, other threads:[~2009-08-18 21:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-12 14:58 [Bug runtime/10512] New: STAP_PROBES don't work in c++ constructors/destructors mjw at redhat dot com
2009-08-12 15:00 ` [Bug runtime/10512] " mjw at redhat dot com
2009-08-12 18:29 ` jistone at redhat dot com
2009-08-14  9:05 ` mjw at redhat dot com
2009-08-14  9:40 ` mjw at redhat dot com
2009-08-14 10:07 ` mjw at redhat dot com
2009-08-17 10:26 ` mjw at redhat dot com
2009-08-17 12:09 ` mjw at redhat dot com
2009-08-17 14:03 ` mjw at redhat dot com
2009-08-17 22:25 ` mjw at redhat dot com
2009-08-18 10:54 ` mjw at redhat dot com
2009-08-18 10:55 ` mjw at redhat dot com
2009-08-18 21:41 ` mjw 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).