4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 #ident "%Z%%M% %I% %E% SMI"
29 echo expected one argument: '<'dtrace-path'>'
40 $dtrace -o $file -c $dir/tst.spin.exe -s /dev/stdin <<EOF
42 #pragma D option quiet
43 #pragma D option destructive
44 #pragma D option evaltime=main
47 * Toss out the first 100 samples to wait for the program to enter
52 /pid == \$target && n++ > 100/
55 @stacks[ustack(4)] = count();
72 trace("test timed out");
77 /pid == \$target && done/
85 printa("TOTAL %@u\n", @total);
86 printa("START%kEND\n", @stacks);
91 if [ "$status" -ne 0 ]; then
92 echo $tst: dtrace failed
96 perl /dev/stdin $file <<EOF
99 die "output problem\n" unless /^TOTAL (\d+)/;
101 die "too few samples (\$count)\n" unless \$count >= 1000;
108 die "expected START at \$.\n" unless /^START/;
113 die "expected END at \$.\n" unless /\`baz\+/;
117 die "expected END at \$.\n" unless /\`bar\+/;
121 die "expected END at \$.\n" unless /\`foo\+/;
125 die "expected END at \$.\n" unless /\`main\+/;
129 die "expected END at \$.\n" unless /^END\$/;
135 if [ "$status" -eq 0 ]; then