Re: [dtrace-discuss] Dtrace providers and C, C++

2010-11-18 Thread Mike DeMarco
I was hoping to do something as simple as link in the dtrace library, include 
the headers and then use a c call to invoke a provider filling data structures. 
I will take a look at the lockstat code you mentioned maybe gleam an idea or 
two from it..


Thanks
-- 
This message posted from opensolaris.org
___
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org


Re: [dtrace-discuss] Dtrace providers and C, C++

2010-11-18 Thread Mike DeMarco
Kudos to whoever wrote the header files. Very well documented.

I will research but looks like dtrace_probe() will do what I want..


I remember seeing a blurb somewhere saying not to trust the library as it could 
and will change with growth. Is this true?
-- 
This message posted from opensolaris.org
___
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org


Re: [dtrace-discuss] Dtrace providers and C, C++

2010-11-18 Thread Angelo Rajadurai
Hi Mike:

James is right, this is private interface. You are on your own as far as 
stability is concerned.
But if you are still interested I have provided some step by step example of 
using the C API in 
my dtrace hands on lab. See http://dtracehol.com/#Exercise_15

-Angelo

On Nov 18, 2010, at 8:35 AM, James Carlson wrote:

 Mike DeMarco wrote:
 Kudos to whoever wrote the header files. Very well documented.
 
 I will research but looks like dtrace_probe() will do what I want..
 
 
 I remember seeing a blurb somewhere saying not to trust the library as it 
 could and will change with growth. Is this true?
 
 The usual rule is that if there is no man page describing the interface
 you're using, then it's technically classified as private.  That
 doesn't mean that it's any sort of secret or that you can't use it,
 but rather that it can change arbitrarily over time without notice.
 Unless you get special agreement from the person or team that's
 maintaining the interface, you can't depend on it remaining compatible.
 
 -- 
 James Carlson 42.703N 71.076W carls...@workingcode.com
 ___
 dtrace-discuss mailing list
 dtrace-discuss@opensolaris.org

___
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org


Re: [dtrace-discuss] Dtrace providers and C, C++

2010-11-18 Thread Mike DeMarco
 Hi Mike:
 
 James is right, this is private interface. You are on
 your own as far as stability is concerned.
 But if you are still interested I have provided some
 step by step example of using the C API in 
 my dtrace hands on lab. See
 http://dtracehol.com/#Exercise_15
 
 -Angelo
Excellent!!! Thanks I will take a gander.
-- 
This message posted from opensolaris.org
___
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org


Re: [dtrace-discuss] Dtrace providers and C, C++

2010-11-17 Thread Adam Leventhal
Hey Mike,

Are you asking if you can programmatically control DTrace? There's a C
API (that you can certainly invoke from C++), but it's private and not
stable. intrstat and plockstat are good example whose source code you
can find here:

  http://www.illumos.org/projects/illumos-gate/repository/show/usr/src/cmd

To interact with DTrace in a stable way, I'd suggest you spawn a
dtrace(1M) child process, format the output in a way that's conducive
to the parsing you need to do.

Adam

On Wed, Nov 17, 2010 at 11:52 AM, Mike DeMarco mikej...@yahoo.com wrote:
 Can Dtrace providers be enabled and data collected from within a C++ program?
 --
 This message posted from opensolaris.org
 ___
 dtrace-discuss mailing list
 dtrace-discuss@opensolaris.org




-- 
Adam Leventhal, Delphix                        http://dtrace.org/blogs/ahl
___
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org