Robert Gould
Robert Gould

Reputation: 69855

Setting my own probes with Dtrace in C++

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

Upvotes: 3

Views: 2018

Answers (2)

Robert Gould
Robert Gould

Reputation: 69855

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

Upvotes: 2

Brian Campbell
Brian Campbell

Reputation: 332856

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

Upvotes: 1

Related Questions