3

I have some custom dtrace probes in a C-library, and when linking and using the library with a C application my probes work fine, however when linked against C++ it says it can't find them. The reason seems to be because of C++ mangling, and trying to get it to work has become a duck chase.

Any ideas?

Note: Using gcc

Robert Gould
  • 68,773
  • 61
  • 187
  • 272

2 Answers2

2

So far I've found these "useful" links

Using DTrace to Profile and Debug A C++ Program

Using DTrace SDT provider with C++

but they haven't solved my problems.

Later on I found these articles:

User-land tracing gets better and better //this was very helpful

Putting developer-defined DTrace probe points in an application

Dtrace Using SDT probes //pdf that helped understand some details, but information is old

Basically it all boils down to using dtrace -h to headerfiles from ones probes.d

Sai Charan
  • 260
  • 1
  • 2
  • 12
Robert Gould
  • 68,773
  • 61
  • 187
  • 272
1

Did you try extern "C" { ... } when declaring the C functions?

Brian Campbell
  • 322,767
  • 57
  • 360
  • 340