Print this page
4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation missing checks
Reviewed by: Bryan Cantrill <bryan@joyent.com>


  52          * Unfortunately, a "return" probe is not currently possible due to
  53          * the conflict with a reserved word.
  54          */
  55         DTRACE_PROBE(test_prov, done);
  56 }
  57 EOF
  58 
  59 cat > prov.d <<EOF
  60 provider test_prov {
  61         probe entry();
  62         probe __entry();
  63         probe foo__entry();
  64         probe carpentry();
  65         probe miniatureturn();
  66         probe foo__return();
  67         probe __return();
  68         probe done();
  69 };
  70 EOF
  71 
  72 gcc -c test.c
  73 if [ $? -ne 0 ]; then
  74         print -u2 "failed to compile test.c"
  75         exit 1
  76 fi
  77 $dtrace -G -32 -s prov.d test.o
  78 if [ $? -ne 0 ]; then
  79         print -u2 "failed to create DOF"
  80         exit 1
  81 fi
  82 gcc -o test test.o prov.o
  83 if [ $? -ne 0 ]; then
  84         print -u2 "failed to link final executable"
  85         exit 1
  86 fi
  87 
  88 script()
  89 {
  90         $dtrace -wqZFs /dev/stdin <<EOF
  91         BEGIN
  92         {
  93                 system("$DIR/test");
  94                 printf("\n");
  95         }
  96 
  97         test_prov*:::done
  98         /progenyof(\$pid)/
  99         {
 100                 exit(0);
 101         }
 102 


  52          * Unfortunately, a "return" probe is not currently possible due to
  53          * the conflict with a reserved word.
  54          */
  55         DTRACE_PROBE(test_prov, done);
  56 }
  57 EOF
  58 
  59 cat > prov.d <<EOF
  60 provider test_prov {
  61         probe entry();
  62         probe __entry();
  63         probe foo__entry();
  64         probe carpentry();
  65         probe miniatureturn();
  66         probe foo__return();
  67         probe __return();
  68         probe done();
  69 };
  70 EOF
  71 
  72 gcc -m32 -c test.c
  73 if [ $? -ne 0 ]; then
  74         print -u2 "failed to compile test.c"
  75         exit 1
  76 fi
  77 $dtrace -G -32 -s prov.d test.o
  78 if [ $? -ne 0 ]; then
  79         print -u2 "failed to create DOF"
  80         exit 1
  81 fi
  82 gcc -m32 -o test test.o prov.o
  83 if [ $? -ne 0 ]; then
  84         print -u2 "failed to link final executable"
  85         exit 1
  86 fi
  87 
  88 script()
  89 {
  90         $dtrace -wqZFs /dev/stdin <<EOF
  91         BEGIN
  92         {
  93                 system("$DIR/test");
  94                 printf("\n");
  95         }
  96 
  97         test_prov*:::done
  98         /progenyof(\$pid)/
  99         {
 100                 exit(0);
 101         }
 102