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.
28 echo expected one argument
: '<'dtrace-path
'>'
37 dir
=`/bin/dirname $tst`
39 $dtrace -o $file -c $dir/tst.spin.exe
-s /dev
/stdin
<<EOF
41 #pragma D option quiet
42 #pragma D option destructive
43 #pragma D option evaltime=main
46 * Toss out the first 100 samples to wait for the program to enter
51 /pid == \$target && n++ > 100/
54 @stacks[ustack(4)] = count();
71 trace("test timed out");
76 /pid == \$target && done/
84 printa("TOTAL %@u\n", @total);
85 printa("START%kEND\n", @stacks);
90 if [ "$status" -ne 0 ]; then
91 echo $tst: dtrace failed
95 perl
/dev
/stdin
$file <<EOF
98 die "output problem\n" unless /^TOTAL (\d+)/;
100 die "too few samples (\$count)\n" unless \$count >= 1000;
107 die "expected START at \$.\n" unless /^START/;
112 die "expected END at \$.\n" unless /\`baz\+/;
116 die "expected END at \$.\n" unless /\`bar\+/;
120 die "expected END at \$.\n" unless /\`foo\+/;
124 die "expected END at \$.\n" unless /\`main\+/;
128 die "expected END at \$.\n" unless /^END\$/;
134 if [ "$status" -eq 0 ]; then