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>


  46         DTRACE_PROBE(test_prov, zero);
  47         DTRACE_PROBE1(test_prov, one, 1);
  48         DTRACE_PROBE2(test_prov, two, 2, 3);
  49         DTRACE_PROBE3(test_prov, three, 4, 5, 7);
  50         DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10);
  51         DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15);
  52 }
  53 EOF
  54 
  55 cat > prov.d <<EOF
  56 provider test_prov {
  57         probe zero();
  58         probe one(uintptr_t);
  59         probe two(uintptr_t, uintptr_t);
  60         probe three(uintptr_t, uintptr_t, uintptr_t);
  61         probe four(uintptr_t, uintptr_t, uintptr_t, uintptr_t);
  62         probe five(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
  63 };
  64 EOF
  65 
  66 gcc -c test.c
  67 if [ $? -ne 0 ]; then
  68         print -u2 "failed to compile test.c"
  69         exit 1
  70 fi
  71 $dtrace -G -32 -s prov.d test.o
  72 if [ $? -ne 0 ]; then
  73         print -u2 "failed to create DOF"
  74         exit 1
  75 fi
  76 gcc -o test test.o prov.o
  77 if [ $? -ne 0 ]; then
  78         print -u2 "failed to link final executable"
  79         exit 1
  80 fi
  81 
  82 cd /
  83 /usr/bin/rm -rf $DIR


  46         DTRACE_PROBE(test_prov, zero);
  47         DTRACE_PROBE1(test_prov, one, 1);
  48         DTRACE_PROBE2(test_prov, two, 2, 3);
  49         DTRACE_PROBE3(test_prov, three, 4, 5, 7);
  50         DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10);
  51         DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15);
  52 }
  53 EOF
  54 
  55 cat > prov.d <<EOF
  56 provider test_prov {
  57         probe zero();
  58         probe one(uintptr_t);
  59         probe two(uintptr_t, uintptr_t);
  60         probe three(uintptr_t, uintptr_t, uintptr_t);
  61         probe four(uintptr_t, uintptr_t, uintptr_t, uintptr_t);
  62         probe five(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
  63 };
  64 EOF
  65 
  66 gcc -m32 -c test.c
  67 if [ $? -ne 0 ]; then
  68         print -u2 "failed to compile test.c"
  69         exit 1
  70 fi
  71 $dtrace -G -32 -s prov.d test.o
  72 if [ $? -ne 0 ]; then
  73         print -u2 "failed to create DOF"
  74         exit 1
  75 fi
  76 gcc -m32 -o test test.o prov.o
  77 if [ $? -ne 0 ]; then
  78         print -u2 "failed to link final executable"
  79         exit 1
  80 fi
  81 
  82 cd /
  83 /usr/bin/rm -rf $DIR