How do I bind my C++ application to DTrace?

  • Follow


Note: I did RTFM! (more or less)  :-)

It seems like the bulk of dtrace's functionality relies on writing
programs in the D language. I could not find a reference to MY
application, the one I am trying to trace and improve.

That should have been the very first example.

TIA,

-Ramon

0
Reply ramon (1465) 11/3/2011 6:15:13 PM

On 2011-11-03 18:15:13 +0000, Ramon F Herrera said:

> Note: I did RTFM! (more or less)  :-)
> 
> It seems like the bulk of dtrace's functionality relies on writing
> programs in the D language. I could not find a reference to MY
> application, the one I am trying to trace and improve.
> 
> That should have been the very first example.

The documentation makes it quite hard to get started IMO. I found it 
quite helpful having the DTrace cheat sheet printed out - see 
<http://blogs.oracle.com/brendan/entry/dtrace_cheatsheet>

You could try using the pid provider to instrument your application's 
function entry/return points. If you're using C++ then you need to find 
the C++ mangled names.

Something like this will run and trace myapp:

dtrace -n 'pid$target::functionname:entry { }' -c "myapp -arg1 -arg2"

Try doing that before starting to compile your own (USDT) probes into 
your app - walk around a lot before starting to run!
-- 
Chris

0
Reply Chris 11/3/2011 6:54:41 PM


1 Replies
82 Views

(page loaded in 0.07 seconds)

Similiar Articles:











7/23/2012 10:30:43 AM


Reply: