This drove me nuts until a colleague helped me nail down a small test case.  
I'm posting here before filing a bug in case I'm somehow overlooking something 
that would justify what I'm seeing.  This is on Solaris, both S10 and 
OpenSolaris (whatever release is snv_111b), by the way.

I have defined two providers, named A and B, and I have a program that uses 
either a probe from each or only from one.  If it uses both, everything works 
as expected.  If it uses only one, that probe disappears.  Somehow, adding the 
second, unused provider to the "dtrace -G" seems to make the probe for the 
first provider go away.

Here's the test program, main.c:

#include "providerA.h"
#include "providerB.h"

int main() {
   A_HELLO();
#ifdef USE_B
   B_BYE();
#endif
   return 0;
}

With both probes in place, I get this:

$ dtrace -h -s providerA.d
$ dtrace -h -s providerB.d
$ cc -o main.o -c -DUSE_B main.c
$ dtrace -G -s providerA.d -s providerB.d -o providers.o main.o
$ cc -o program main.o providers.o
$ dtrace -l -P 'A$target' -P 'B$target' -c ./program
  ID   PROVIDER            MODULE                          FUNCTION NAME
63692     A12109           program                              main hello
63693     B12109           program                              main bye

Just as expected.  With only one probe in place, I get this:

$ dtrace -h -s providerA.d
$ dtrace -h -s providerB.d
$ cc -o main.o -c main.c
$ dtrace -G -s providerA.d -s providerB.d -o providers.o main.o
$ cc -o program main.o providers.o
$ dtrace -l -P 'A$target' -P 'B$target' -c ./program
  ID   PROVIDER            MODULE                          FUNCTION NAME
dtrace: failed to match A12161:::: No probe matches description
dtrace: failed to match B12161:::: No probe matches description

I expect the B probe to be missing, but what happened to the A probe?

The providers are trivial:
$ cat providerA.d providerB.d
provider A {
   probe hello();
};
provider B {
   probe bye();
};

Any clues?
Thanks.
joe

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

Reply via email to