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