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>


  59 
  60 int
  61 foo(void)
  62 {
  63         return (24);
  64 }
  65 
  66 int
  67 main(int argc, char **argv)
  68 {
  69         int a = foo();
  70         if (TEST_PROV_GO_ENABLED()) {
  71                 TEST_PROV_GO();
  72         }
  73         (void) printf("%d %d %d\n", a, a, a);
  74 
  75         return (0);
  76 }
  77 EOF
  78 
  79 gcc -c test.c
  80 if [ $? -ne 0 ]; then
  81         print -u2 "failed to compile test.c"
  82         exit 1
  83 fi
  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 gcc -o test test.o prov.o

  90 if [ $? -ne 0 ]; then
  91         print -u2 "failed to link final executable"
  92         exit 1
  93 fi
  94 
  95 script()
  96 {
  97         ./test
  98 
  99         $dtrace -c ./test -qs /dev/stdin <<EOF
 100         test_prov\$target:::
 101         {
 102         }
 103 EOF
 104 }
 105 
 106 script
 107 status=$?
 108 
 109 cd /


  59 
  60 int
  61 foo(void)
  62 {
  63         return (24);
  64 }
  65 
  66 int
  67 main(int argc, char **argv)
  68 {
  69         int a = foo();
  70         if (TEST_PROV_GO_ENABLED()) {
  71                 TEST_PROV_GO();
  72         }
  73         (void) printf("%d %d %d\n", a, a, a);
  74 
  75         return (0);
  76 }
  77 EOF
  78 
  79 gcc -m32 -c test.c
  80 if [ $? -ne 0 ]; then
  81         print -u2 "failed to compile test.c"
  82         exit 1
  83 fi
  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 script()
  97 {
  98         ./test
  99 
 100         $dtrace -c ./test -qs /dev/stdin <<EOF
 101         test_prov\$target:::
 102         {
 103         }
 104 EOF
 105 }
 106 
 107 script
 108 status=$?
 109 
 110 cd /