29 # This test verifies that USDT probes will be picked up after a dlopen(3C)
30 # when a regex in the provider name matches both USDT probes and pid probes
31 # (e.g., p*d$target matches both pid$target and pyramid$target.)
32 #
33
34 if [ $# != 1 ]; then
35 echo expected one argument: '<'dtrace-path'>'
36 exit 2
37 fi
38
39 dtrace=$1
40 DIR=${TMPDIR:-/tmp}/dtest.$$
41
42 mkdir $DIR
43 cd $DIR
44
45 cat > Makefile <<EOF
46 all: main altlib.so
47
48 main: main.o provmain.o
49 gcc -o main main.o provmain.o
50
51 main.o: main.c prov.h
52 gcc -c main.c
53
54 prov.h: prov.d
55 $dtrace -h -s prov.d
56
57 provmain.o: prov.d main.o
58 $dtrace -G -32 -o provmain.o -s prov.d main.o
59
60 altlib.so: altlib.o provalt.o
61 gcc -shared -o altlib.so altlib.o provalt.o -lc
62
63 altlib.o: altlib.c prov.h
64 gcc -c altlib.c
65
66 provalt.o: prov.d altlib.o
67 $dtrace -G -32 -o provalt.o -s prov.d altlib.o
68 EOF
69
70 cat > prov.d <<EOF
71 provider pyramid {
72 probe entry();
73 };
74 EOF
75
76 cat > altlib.c <<EOF
77 #include <sys/sdt.h>
78 #include "prov.h"
79
80 void
81 go(void)
82 {
83 PYRAMID_ENTRY();
84 }
|
29 # This test verifies that USDT probes will be picked up after a dlopen(3C)
30 # when a regex in the provider name matches both USDT probes and pid probes
31 # (e.g., p*d$target matches both pid$target and pyramid$target.)
32 #
33
34 if [ $# != 1 ]; then
35 echo expected one argument: '<'dtrace-path'>'
36 exit 2
37 fi
38
39 dtrace=$1
40 DIR=${TMPDIR:-/tmp}/dtest.$$
41
42 mkdir $DIR
43 cd $DIR
44
45 cat > Makefile <<EOF
46 all: main altlib.so
47
48 main: main.o provmain.o
49 gcc -m32 -o main main.o provmain.o
50
51 main.o: main.c prov.h
52 gcc -m32 -c main.c
53
54 prov.h: prov.d
55 $dtrace -h -s prov.d
56
57 provmain.o: prov.d main.o
58 $dtrace -G -32 -o provmain.o -s prov.d main.o
59
60 altlib.so: altlib.o provalt.o
61 gcc -m32 -shared -o altlib.so altlib.o provalt.o -lc
62
63 altlib.o: altlib.c prov.h
64 gcc -m32 -c altlib.c
65
66 provalt.o: prov.d altlib.o
67 $dtrace -G -32 -o provalt.o -s prov.d altlib.o
68 EOF
69
70 cat > prov.d <<EOF
71 provider pyramid {
72 probe entry();
73 };
74 EOF
75
76 cat > altlib.c <<EOF
77 #include <sys/sdt.h>
78 #include "prov.h"
79
80 void
81 go(void)
82 {
83 PYRAMID_ENTRY();
84 }
|