Hi , I am debugging a 3rd party kernel module. I want to print some of the values of the DS for the 3rd party kernel module. e.g fbt::xyz_open:entry { this->p = args[1]->name; printf("The name is %s \n", args[1]->name); } It is throwing the following error. dtrace: failed to compile script ./1.d: line 19: no args[ ] are available for probe fbt::xyz_open:entry Please let me know where the problem is. Regards, GVR This message posted from opensolaris.org
The function argument type information is made available through CTF data (a compressed type format) in the traced kernel module. Third party modules will not usually have CTF data as the tools for generating CTF information haven''t been published. In this case, you can use the argN variables and cast them to a type from a header file that you include (specify -C to run the C-preprocessor) or that you define yourself in the D script. #include <xyz.h> fbt::xyz_open:entry { this->p = ((xyz_t *)arg1)->name; printf("The name is %s\", this->p); } Adam On Mon, Nov 07, 2005 at 04:26:39AM -0800, Vinay wrote:> Hi , > > I am debugging a 3rd party kernel module. I want to print some of the values of the DS for the 3rd party kernel module. > e.g > fbt::xyz_open:entry > { > this->p = args[1]->name; > printf("The name is %s \n", args[1]->name); > } > It is throwing the following error. > dtrace: failed to compile script ./1.d: line 19: no args[ ] are available for probe fbt::xyz_open:entry > > Please let me know where the problem is. > > Regards, > GVR > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Hi Adam, Thanks for your response. I am still facing some problems. e.g I have a struct test in my header file /home/include/test.h struct test { char *name; }; /* xyz_open takes pointer to structure test as the first argumnet */ fbt::xyz_open:entry { t1 = (struct test *)arg0; printf(" Name is %s\n", t1->name); } I compile the dtrace script by : # dtrace -C -I/home/include -s test.d dtrace: failed to compile script test.d , line 4: name is not a member of struct test. Please let me know what could be the problem. GVR This message posted from opensolaris.org
Roch Bourbonnais - Performance Engineering
2005-Nov-08 09:42 UTC
[dtrace-discuss] Re: fbt provider
Do you have #include "test.h" in the d-script ? Vinay writes: > Hi Adam, > Thanks for your response. I am still facing some problems. e.g > I have a struct test in my header file /home/include/test.h > struct test > { > char *name; > }; > /* xyz_open takes pointer to structure test as the first argumnet */ > fbt::xyz_open:entry > { > t1 = (struct test *)arg0; > printf(" Name is %s\n", t1->name); > } > > I compile the dtrace script by : > # dtrace -C -I/home/include -s test.d > dtrace: failed to compile script test.d , line 4: name is not a member of struct test. > > Please let me know what could be the problem. > GVR > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org
I am using dtrace with the include option(-I). #dtrace -C -I/home/include -s test.d I have test.h in /home/include directory. --- Roch Bourbonnais - Performance Engineering <Roch.Bourbonnais at Sun.COM> wrote:> > Do you have > > #include "test.h" > > in the d-script ? > > Vinay writes: > > > Hi Adam, > > Thanks for your response. I am still facing some > problems. e.g > > I have a struct test in my header file > /home/include/test.h > > struct test > > { > > char *name; > > }; > > /* xyz_open takes pointer to structure test as > the first argumnet */ > > fbt::xyz_open:entry > > { > > t1 = (struct test *)arg0; > > printf(" Name is %s\n", t1->name); > > } > > > > I compile the dtrace script by : > > # dtrace -C -I/home/include -s test.d > > dtrace: failed to compile script test.d , line 4: > name is not a member of struct test. > > > > Please let me know what could be the problem. > > GVR > > This message posted from opensolaris.org > > _______________________________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > >__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
Roch Bourbonnais - Performance Engineering
2005-Nov-08 10:02 UTC
[dtrace-discuss] Re: fbt provider
Vinay Rao G writes: > I am using dtrace with the include option(-I). > > #dtrace -C -I/home/include -s test.d > > I have test.h in /home/include directory. and I believe you need #include "test.h" in test.d. This will tell the d-script what "struct test" is about. For kernel module the information is gotten from the ctf data but for external modules you need to provide the extra info. -r > > --- Roch Bourbonnais - Performance Engineering > <Roch.Bourbonnais at Sun.COM> wrote: > > > > > Do you have > > > > #include "test.h" > > > > in the d-script ? > > > > Vinay writes: > > > > > Hi Adam, > > > Thanks for your response. I am still facing some > > problems. e.g > > > I have a struct test in my header file > > /home/include/test.h > > > struct test > > > { > > > char *name; > > > }; > > > /* xyz_open takes pointer to structure test as > > the first argumnet */ > > > fbt::xyz_open:entry > > > { > > > t1 = (struct test *)arg0; > > > printf(" Name is %s\n", t1->name); > > > } > > > > > > I compile the dtrace script by : > > > # dtrace -C -I/home/include -s test.d > > > dtrace: failed to compile script test.d , line 4: > > name is not a member of struct test. > > > > > > Please let me know what could be the problem. > > > GVR > > > This message posted from opensolaris.org > > > _______________________________________________ > > > dtrace-discuss mailing list > > > dtrace-discuss at opensolaris.org > > > > > > > > > __________________________________ > Yahoo! FareChase: Search multiple travel sites in one click. > http://farechase.yahoo.com
> I am using dtrace with the include option(-I). > > #dtrace -C -I/home/include -s test.d > > I have test.h in /home/include directory.This works for me (and should work). Can you attach the exact content of your test.h file? Also add the -H option on the dtrace command line. Do you see cpp print out the path to your header file? -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/
Vinay Rao G wrote:> > I am using dtrace with the include option(-I). > > #dtrace -C -I/home/include -s test.d > > I have test.h in /home/include directory.you aren''t answering Roch''s specific question: is there a line ''#include "test.h"'' in your D-script? if not, then you need to put one in. If there is, then please follow Mike Shapiro''s suggestions.> --- Roch Bourbonnais - Performance Engineering > <Roch.Bourbonnais at Sun.COM> wrote: > > > > > Do you have > > > > #include "test.h" > > > > in the d-script ? > >-- Michael Schuster (+49 89) 46008-2974 / x62974 visit the online support center: http://www.sun.com/osc/ Recursion, n.: see ''Recursion''
Vinay Rao G wrote:> > Hi Mike, > > I am facing an issue when compiling dtrace script. I > get this error when I compile the script. > > dtrace: failed to compile script test.d > "/usr/include/sys/kstat.h", line 439: invalid type > combination > > I went through Dtrace bug database. I found out there > is a simillar bug (bug id 6315039) already existing. > > Presently the state for the bug is closed. Could you > please let me know what I need to do for fixing my > compilation problem.I had a quick look in sunsolve, this seems to have been fixed in a recent build of Solaris Nevada - don''t know whether it''s available in Solaris Express yet. I''ll let people more familiar with DTrace/Sol.Express/Opensolaris current affairs confirm/amend this. Michael -- Michael Schuster (+49 89) 46008-2974 / x62974 visit the online support center: http://www.sun.com/osc/ Recursion, n.: see ''Recursion''
It went into build 23 of nevada, so it should be integrated into SX. alan. Michael Schuster - Sun Germany wrote:> Vinay Rao G wrote: > >>Hi Mike, >> >>I am facing an issue when compiling dtrace script. I >>get this error when I compile the script. >> >>dtrace: failed to compile script test.d >>"/usr/include/sys/kstat.h", line 439: invalid type >>combination >> >>I went through Dtrace bug database. I found out there >>is a simillar bug (bug id 6315039) already existing. >> >>Presently the state for the bug is closed. Could you >>please let me know what I need to do for fixing my >>compilation problem. > > > I had a quick look in sunsolve, this seems to have been fixed in a recent > build of Solaris Nevada - don''t know whether it''s available in Solaris > Express yet. I''ll let people more familiar with > DTrace/Sol.Express/Opensolaris current affairs confirm/amend this. > > Michael-- Alan Hargreaves - http://blogs.sun.com/tpenta Kernel/VOSJEC/Performance Staff Engineer Product Technical Support (APAC) Sun Microsystems
On Thu, Nov 10, 2005 at 08:46:54PM +1100, Alan Hargreaves wrote:> It went into build 23 of nevada, so it should be integrated into SX.You can work around the bug by doing: --- cut here --- #!/usr/sbin/dtrace -Cs #define string str #include <whatever.h> #include <more.h> #undef string /* the rest of your D script goes here */ --- cut here --- Cheers, - jonathan> > Michael Schuster - Sun Germany wrote: > >Vinay Rao G wrote: > > > >>Hi Mike, > >> > >>I am facing an issue when compiling dtrace script. I > >>get this error when I compile the script. > >> > >>dtrace: failed to compile script test.d > >>"/usr/include/sys/kstat.h", line 439: invalid type > >>combination > >> > >>I went through Dtrace bug database. I found out there > >>is a simillar bug (bug id 6315039) already existing. > >> > >>Presently the state for the bug is closed. Could you > >>please let me know what I need to do for fixing my > >>compilation problem. > > > > > >I had a quick look in sunsolve, this seems to have been fixed in a recent > >build of Solaris Nevada - don''t know whether it''s available in Solaris > >Express yet. I''ll let people more familiar with > >DTrace/Sol.Express/Opensolaris current affairs confirm/amend this. > > > >Michael > > > -- > Alan Hargreaves - http://blogs.sun.com/tpenta > Kernel/VOSJEC/Performance Staff Engineer > Product Technical Support (APAC) > Sun Microsystems > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Jonathan Adams, Solaris Kernel Development