Brian Utterback
2005-Aug-10 23:31 UTC
[dtrace-discuss] How to get user land struct defs in pid provider.
Pursuent to my previous message, another problem I came across is printing data from user land structures in the pid provider. I was tracing a user function that returned a pointer to a structure. I wanted to print various fields from the sturcture, but I had no idea how to get the declarations into D. I tried including the .h file, but got a lot of nasty error messages about various and sundry problems. I also had to pre-preprocess the .h file, because this particular program has a fairly complex set of nested .h files. So, is there any way to get these things defined like the fbt provider has for the kernel? Perhaps a magic incantation with a ctf''ish tool? I am a little hazy on the way these things work in D. There isn''t a lot of stuff in the manual. Brian Utterback
Adam Leventhal
2005-Aug-10 23:54 UTC
[dtrace-discuss] How to get user land struct defs in pid provider.
On Wed, Aug 10, 2005 at 07:31:49PM -0400, Brian Utterback wrote:> Pursuent to my previous message, another problem I came across is > printing data from user land structures in the pid provider. I was > tracing a user function that returned a pointer to a structure. I wanted > to print various fields from the sturcture, but I had no idea how to get > the declarations into D. I tried including the .h file, but got a lot of > nasty error messages about various and sundry problems. I also had to > pre-preprocess the .h file, because this particular program has a fairly > complex set of nested .h files. > > So, is there any way to get these things defined like the fbt provider > has for the kernel? Perhaps a magic incantation with a ctf''ish tool? I > am a little hazy on the way these things work in D. There isn''t a lot of > stuff in the manual.There isn''t yet. While all the libraries in ON ship with CTF data, we can''t currently take advantage of it. Once we add that support for DTrace you''ll also be able to use the CTF tools on your own apps. Adam -- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Michael Shapiro
2005-Aug-11 02:39 UTC
[dtrace-discuss] How to get user land struct defs in pid provider.
> Pursuent to my previous message, another problem I came across is > printing data from user land structures in the pid provider. I was > tracing a user function that returned a pointer to a structure. I wanted > to print various fields from the sturcture, but I had no idea how to get > the declarations into D. I tried including the .h file, but got a lot of > nasty error messages about various and sundry problems. I also had to > pre-preprocess the .h file, because this particular program has a fairly > complex set of nested .h files.Can you send us the .h file? Are you hitting issues with our current non-ANSI cpp? If so, you can use -xcpppath to use /usr/sfw/bin/cpp instead (this will become the default soon once I get a chance)> So, is there any way to get these things defined like the fbt provider > has for the kernel? Perhaps a magic incantation with a ctf''ish tool? I > am a little hazy on the way these things work in D. There isn''t a lot of > stuff in the manual.If you can''t work around it using the above, the easiest way for now is to take the struct definition and simply stick it at the top of your D program. We''re working on features for direct CTF import, but that is going to take a few more months to finish. -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/
Premal Gandhi
2007-Mar-19 22:22 UTC
[dtrace-discuss] Re: How to get user land struct defs in pid provider.
I am having a similar issue where in I cannot access a structure defination defined in user land. Is there a way that I can reference a structure defination defined in user program(i.e. a library file like libABC.so) in my D script? This message posted from opensolaris.org
Adam Leventhal
2007-Mar-20 19:15 UTC
[dtrace-discuss] Re: How to get user land struct defs in pid provider.
On Mon, Mar 19, 2007 at 03:22:45PM -0700, Premal Gandhi wrote:> I am having a similar issue where in I cannot access a structure > defination defined in user land. Is there a way that I can reference a > structure defination defined in user program(i.e. a library file like > libABC.so) in my D script?There''s currently no way to access type information from a library other than by including the appropriate header files. In the future we''d like to be able to use CTF data as we do today for the kernel and its modules. Adam -- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl