33 DIR=/var/tmp/dtest.$$
34
35 mkdir $DIR
36 cd $DIR
37
38 cat > test.c <<EOF
39 void
40 thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog(void)
41 {
42 while (1)
43 ;
44 }
45
46 int
47 main(int argc, char *argv[])
48 {
49 thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog();
50 }
51 EOF
52
53 gcc -o test test.c
54 if [ $? -ne 0 ]; then
55 print -u2 "failed to compile test.c"
56 exit 1
57 fi
58
59 script()
60 {
61 $dtrace -c ./test -qs /dev/stdin <<EOF
62 profile:::profile-1001hz
63 /pid == \$target/
64 {
65 @[arg1] = count();
66 }
67
68 tick-1s
69 /n++ > 10/
70 {
71 printa("%A %@d\n", @);
72 exit(0);
73 }
|
33 DIR=/var/tmp/dtest.$$
34
35 mkdir $DIR
36 cd $DIR
37
38 cat > test.c <<EOF
39 void
40 thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog(void)
41 {
42 while (1)
43 ;
44 }
45
46 int
47 main(int argc, char *argv[])
48 {
49 thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog();
50 }
51 EOF
52
53 gcc -m32 -o test test.c
54 if [ $? -ne 0 ]; then
55 print -u2 "failed to compile test.c"
56 exit 1
57 fi
58
59 script()
60 {
61 $dtrace -c ./test -qs /dev/stdin <<EOF
62 profile:::profile-1001hz
63 /pid == \$target/
64 {
65 @[arg1] = count();
66 }
67
68 tick-1s
69 /n++ > 10/
70 {
71 printa("%A %@d\n", @);
72 exit(0);
73 }
|