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 runtime/10512] New: STAP_PROBES don't work in c++ constructors/destructors


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.


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