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>


  45         DTRACE_PROBE(test_prov, probe1);
  46         DTRACE_PROBE(test_prov, probe2);
  47 }
  48 
  49 int
  50 main(int argc, char **argv)
  51 {
  52         DTRACE_PROBE(test_prov, probe1);
  53         DTRACE_PROBE(test_prov, probe2);
  54         foo();
  55 }
  56 EOF
  57 
  58 cat > prov.d <<EOF
  59 provider test_prov {
  60         probe probe1();
  61         probe probe2();
  62 };
  63 EOF
  64 
  65 gcc -c test.c
  66 if [ $? -ne 0 ]; then
  67         print -u2 "failed to compile test.c"
  68         exit 1
  69 fi
  70 $dtrace -G -32 -s prov.d test.o
  71 if [ $? -ne 0 ]; then
  72         print -u2 "failed to create DOF"
  73         exit 1
  74 fi
  75 gcc -o test test.o prov.o
  76 if [ $? -ne 0 ]; then
  77         print -u2 "failed to link final executable"
  78         exit 1
  79 fi
  80 
  81 script()
  82 {
  83         $dtrace -c ./test -qs /dev/stdin <<EOF
  84         test_prov\$target:::
  85         {
  86                 printf("%s:%s:%s\n", probemod, probefunc, probename);
  87         }
  88 EOF
  89 }
  90 
  91 script
  92 status=$?
  93 
  94 cd /
  95 /usr/bin/rm -rf $DIR


  45         DTRACE_PROBE(test_prov, probe1);
  46         DTRACE_PROBE(test_prov, probe2);
  47 }
  48 
  49 int
  50 main(int argc, char **argv)
  51 {
  52         DTRACE_PROBE(test_prov, probe1);
  53         DTRACE_PROBE(test_prov, probe2);
  54         foo();
  55 }
  56 EOF
  57 
  58 cat > prov.d <<EOF
  59 provider test_prov {
  60         probe probe1();
  61         probe probe2();
  62 };
  63 EOF
  64 
  65 gcc -m32 -c test.c
  66 if [ $? -ne 0 ]; then
  67         print -u2 "failed to compile test.c"
  68         exit 1
  69 fi
  70 $dtrace -G -32 -s prov.d test.o
  71 if [ $? -ne 0 ]; then
  72         print -u2 "failed to create DOF"
  73         exit 1
  74 fi
  75 gcc -m32 -o test test.o prov.o
  76 if [ $? -ne 0 ]; then
  77         print -u2 "failed to link final executable"
  78         exit 1
  79 fi
  80 
  81 script()
  82 {
  83         $dtrace -c ./test -qs /dev/stdin <<EOF
  84         test_prov\$target:::
  85         {
  86                 printf("%s:%s:%s\n", probemod, probefunc, probename);
  87         }
  88 EOF
  89 }
  90 
  91 script
  92 status=$?
  93 
  94 cd /
  95 /usr/bin/rm -rf $DIR