Terry Dontje
2007-Oct-03 14:01 UTC
[dtrace-discuss] Translators and multiply defined probenames
I have a code that has several probes with the same probename. When I define the probe to use a translator and then try to match for all the occurances of the probename in a D script I get the following error: dtrace: invalid probe specifier mpi__test$target:::RECV_REQ_ACT_EV { printf("%d %d", args[0]->bar, args[0]->baz); }: in action list: args[ ] may not be referenced because probe description mpi__test9055:::RECV_REQ_ACT_EV matches an unstable set of probes However if I specify the function the probe exists in things work fine. Like so, dtrace -c main -n ''mpi__test$target::recv_1:RECV_REQ_ACT_EV { printf("%d %d", args[0]->bar, args[0]->baz); }'' dtrace: description ''mpi__test$target::recv_1:RECV_REQ_ACT_EV '' matched 1 probe dtrace: pid 9057 has exited CPU ID FUNCTION:NAME 0 43963 recv_1:RECV_REQ_ACT_EV 1 2 My question is there a way that if these two probes with the same probename can be defined such that the failing case would work? The reason I want to do this is in the case of MPI the probenames are Events and the certain events can be triggered in multiple places in the code. I''d also would like to avoid requiring D script writers to have to explicitly state which functions the probenames occur because I could see this possibly changing with time. A simple example of what I am doing follows: ----main.c---- void main() { recv_1(); recv_2(); } ----recv.c---- #include <sys/sdt.h> void recv_1() { struct foo { int bar; int baz; } me; me.bar = 1; me.baz = 2; DTRACE_PROBE1(mpi__test, RECV_REQ_ACT_EV, &me); } void recv_2() { struct foo { int bar; int baz; } me; me.bar = 3; me.baz = 4; DTRACE_PROBE1(mpi__test, RECV_REQ_ACT_EV, &me); } ----mpi_provider.d---- typedef struct infoo_t { int dummy; } infoo_t; typedef struct outfoo { int dummy; } outfoo_t; translator outfoo_t <infoo_t *P> { dummy = P->dummy; }; provider mpi__test { probe RECV_REQ_ACT_EV (infoo_t *i) : (outfoo_t *i); }; ----mpi.d---- typedef struct infoo_t { int bar; int baz; } infoo_t; typedef struct outfoo { int bar; int baz; } outfoo_t; #pragma D binding "1.5" translator translator outfoo_t <infoo_t *P> { bar = *(int *)copyin((uintptr_t)&P->bar, sizeof (int)); baz = *(int *)copyin((uintptr_t)&P->baz, sizeof (int)); }; thanks, --td -- This message posted from opensolaris.org