Is trying to access a typed argument from a USDT probe allowed? I have a script that does "printf("%s\n", copyinstr(args[0]->ci_protocol);" and I get the error message of "dtrace: failed to compile script mpiconn.d: line 12: failed to resolve translated type for args[0]"? --td -- This message posted from opensolaris.org
You can certainly access typed arguments from USDT probes. Can you send the full script? If you''re using the conninfo_t you may want to take a look at what I did in the iSCSI target provider and some scripts that Brendan Gregg wrote that use the provider. Adam On Wed, Sep 05, 2007 at 12:16:50PM -0700, Terry Dontje wrote:> Is trying to access a typed argument from a USDT probe allowed? > I have a script that does "printf("%s\n", copyinstr(args[0]->ci_protocol);" and I get the error message of "dtrace: failed to compile script mpiconn.d: line 12: failed to resolve translated type for args[0]"? > > --td > > > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, FishWorks http://blogs.sun.com/ahl
Ok, I''ve looked at the iSCSI_provider.d and except for the translator code I don''t see anything obvious. In order to simplify things I''ve created a small program that exhibits the same issue. The compilation and failing dtrace execution follows: % cc -c debug.c % dtrace -G -32 -s usdt.d debug.o % cc -o main main.c usdt.o debug.o % dtrace -c main -n ''mpi__test$target::: { printf("%d",args[0]->bar)}'' dtrace: invalid probe specifier mpi__test$target::: { printf("%d",args[0]->bar)}: in action list: failed to resolve translated type for args[0] The code is as follows: -----main.c------ void main() { dprintf(); } -----debug.c----- #include <sys/sdt.h> void dprintf() { struct foo { int bar; int baz; } me; me.bar = 1; me.baz = 2; DTRACE_PROBE1(mpi__test, DEBUG_MESSAGE, &me); } -----usdt.d----- typedef struct foo { int bar; int baz; } foo_t; provider mpi__test { probe DEBUG_MESSAGE(foo_t *); }; thanks, --td> You can certainly access typed arguments from USDT > probes. Can you send > the full script? If you''re using the conninfo_t you > may want to take a look > at what I did in the iSCSI target provider and some > scripts that Brendan > Gregg wrote that use the provider. > > Adam > > On Wed, Sep 05, 2007 at 12:16:50PM -0700, Terry > Dontje wrote: > > Is trying to access a typed argument from a USDT > probe allowed? > > I have a script that does "printf("%s\n", > copyinstr(args[0]->ci_protocol);" and I get the error > message of "dtrace: failed to compile script > mpiconn.d: line 12: failed to resolve translated type > for args[0]"? > > > > --td > > > > > > -- > > This message posted from opensolaris.org > > _______________________________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > -- > Adam Leventhal, FishWorks > http://blogs.sun.com/ahl > ________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- This message posted from opensolaris.org
Oh, you probably haven''t installed a file with your translator in /usr/lib/dtrace -- could that be it? Unfortunately, translators aren''t slurped into the USDT DOF helper. Adam On Fri, Sep 07, 2007 at 07:04:37AM -0700, Terry Dontje wrote:> Ok, I''ve looked at the iSCSI_provider.d and except for the translator code I don''t see anything obvious. In order to simplify things I''ve created a small program that exhibits the same issue. > The compilation and failing dtrace execution follows: > > % cc -c debug.c > % dtrace -G -32 -s usdt.d debug.o > % cc -o main main.c usdt.o debug.o > % dtrace -c main -n ''mpi__test$target::: { printf("%d",args[0]->bar)}'' > dtrace: invalid probe specifier mpi__test$target::: { printf("%d",args[0]->bar)}: in action list: failed to resolve translated type for args[0] > > The code is as follows: > -----main.c------ > void main() { > dprintf(); > } > > -----debug.c----- > #include <sys/sdt.h> > void > dprintf() > { > struct foo { > int bar; > int baz; > } me; > > me.bar = 1; > me.baz = 2; > > DTRACE_PROBE1(mpi__test, DEBUG_MESSAGE, &me); > } > -----usdt.d----- > typedef struct foo { > int bar; > int baz; > } foo_t; > > provider mpi__test { > probe DEBUG_MESSAGE(foo_t *); > }; > > thanks, > > --td > > You can certainly access typed arguments from USDT > > probes. Can you send > > the full script? If you''re using the conninfo_t you > > may want to take a look > > at what I did in the iSCSI target provider and some > > scripts that Brendan > > Gregg wrote that use the provider. > > > > Adam > > > > On Wed, Sep 05, 2007 at 12:16:50PM -0700, Terry > > Dontje wrote: > > > Is trying to access a typed argument from a USDT > > probe allowed? > > > I have a script that does "printf("%s\n", > > copyinstr(args[0]->ci_protocol);" and I get the error > > message of "dtrace: failed to compile script > > mpiconn.d: line 12: failed to resolve translated type > > for args[0]"? > > > > > > --td > > > > > > > > > -- > > > This message posted from opensolaris.org > > > _______________________________________________ > > > dtrace-discuss mailing list > > > dtrace-discuss at opensolaris.org > > > > -- > > Adam Leventhal, FishWorks > > http://blogs.sun.com/ahl > > ________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, FishWorks http://blogs.sun.com/ahl
Not sure why Adam''s reply didn''t come up yet. I saw in my email from Adam the following. ----- Oh, you probably haven''t installed a file with your translator in /usr/lib/dtrace -- could that be it? Unfortunately, translators aren''t slurped into the USDT DOF helper. ----- Not I have not installed the file with my translator into /usr/lib/dtrace. I have done so and now my scripts can see the translator. However one quirky thing came up. If I put the .d file that has the structs defined in the /usr/lib/dtrace and I try to compile the provider I get an error telling me the structure has been redefined. I looks as if I remove all the definitions (structs and translators) out of the provider and keep that stuff in the .d file in /usr/lib/dtrace that things seem to compile fine. So I am up and running. So, I assume this means our products package will need to install the mpiusdt.d definitions in /usr/lib/dtrace, right? thanks, --td -- This message posted from opensolaris.org
On Fri, Sep 07, 2007 at 11:24:32AM -0700, Terry Dontje wrote:> So I am up and running. So, I assume this means our products package > will need to install the mpiusdt.d definitions in /usr/lib/dtrace, > right?You''ll need to deliever _a_ .d file just like the iSCSI target provider does. I suggest you name it after the provider rather -- something like mpi.d -- rather than mpiusdt.d. Adam -- Adam Leventhal, FishWorks http://blogs.sun.com/ahl
> You''ll need to deliever _a_ .d file just like the > iSCSI target provider does. > I suggest you name it after the provider rather -- > something like mpi.d -- > rather than mpiusdt.d. > > Adam >Fair enough I can follow the norm and name the file mpi.d. thanks again, --td -- This message posted from opensolaris.org