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>


  70 EOF
  71 
  72 cat > prov.d <<EOF
  73 provider test {
  74         probe fire(int, int, int);
  75 };
  76 EOF
  77 
  78 /usr/ccs/bin/as -xregsym=no -P -D_ASM -o test.o test.s
  79 if [ $? -ne 0 ]; then
  80         print -u2 "failed to compile test.s"
  81         exit 1
  82 fi
  83 
  84 $dtrace -G -32 -s prov.d test.o
  85 if [ $? -ne 0 ]; then
  86         print -u2 "failed to create DOF"
  87         exit 1
  88 fi
  89 
  90 gcc -o test test.o prov.o
  91 if [ $? -ne 0 ]; then
  92         print -u2 "failed to link final executable"
  93         exit 1
  94 fi
  95 
  96 $dtrace -c ./test -s /dev/stdin <<EOF
  97 test\$target:::fire
  98 /arg0 == 9 && arg1 == 19 && arg2 == 2006/
  99 {
 100         printf("%d/%d/%d", arg0, arg1, arg2);
 101         exit(0);
 102 }
 103 
 104 test\$target:::fire
 105 {
 106         printf("%d/%d/%d", arg0, arg1, arg2);
 107         exit(1);
 108 }
 109 
 110 BEGIN




  70 EOF
  71 
  72 cat > prov.d <<EOF
  73 provider test {
  74         probe fire(int, int, int);
  75 };
  76 EOF
  77 
  78 /usr/ccs/bin/as -xregsym=no -P -D_ASM -o test.o test.s
  79 if [ $? -ne 0 ]; then
  80         print -u2 "failed to compile test.s"
  81         exit 1
  82 fi
  83 
  84 $dtrace -G -32 -s prov.d test.o
  85 if [ $? -ne 0 ]; then
  86         print -u2 "failed to create DOF"
  87         exit 1
  88 fi
  89 
  90 gcc -m32 -o test test.o prov.o
  91 if [ $? -ne 0 ]; then
  92         print -u2 "failed to link final executable"
  93         exit 1
  94 fi
  95 
  96 $dtrace -c ./test -s /dev/stdin <<EOF
  97 test\$target:::fire
  98 /arg0 == 9 && arg1 == 19 && arg2 == 2006/
  99 {
 100         printf("%d/%d/%d", arg0, arg1, arg2);
 101         exit(0);
 102 }
 103 
 104 test\$target:::fire
 105 {
 106         printf("%d/%d/%d", arg0, arg1, arg2);
 107         exit(1);
 108 }
 109 
 110 BEGIN