1*2870Sdp#
2*2870Sdp# CDDL HEADER START
3*2870Sdp#
4*2870Sdp# The contents of this file are subject to the terms of the
5*2870Sdp# Common Development and Distribution License (the "License").
6*2870Sdp# You may not use this file except in compliance with the License.
7*2870Sdp#
8*2870Sdp# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2870Sdp# or http://www.opensolaris.org/os/licensing.
10*2870Sdp# See the License for the specific language governing permissions
11*2870Sdp# and limitations under the License.
12*2870Sdp#
13*2870Sdp# When distributing Covered Code, include this CDDL HEADER in each
14*2870Sdp# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2870Sdp# If applicable, add the following below this CDDL HEADER, with the
16*2870Sdp# fields enclosed by brackets "[]" replaced with your own identifying
17*2870Sdp# information: Portions Copyright [yyyy] [name of copyright owner]
18*2870Sdp#
19*2870Sdp# CDDL HEADER END
20*2870Sdp#
21*2870Sdp
22*2870Sdp#
23*2870Sdp# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*2870Sdp# Use is subject to license terms.
25*2870Sdp#
26*2870Sdp#ident	"%Z%%M%	%I%	%E% SMI"
27*2870Sdp
28*2870Sdpppriv -s A=basic,dtrace_proc,dtrace_user $$
29*2870Sdp
30*2870Sdp/usr/sbin/dtrace -q -s /dev/stdin <<"EOF"
31*2870Sdp
32*2870SdpBEGIN {
33*2870Sdp	errorcount = 0;
34*2870Sdp	expected_errorcount = 23;
35*2870Sdp}
36*2870Sdp
37*2870SdpBEGIN { trace(mutex_owned(&`pidlock)); }
38*2870SdpBEGIN { trace(mutex_owner(&`pidlock)); }
39*2870SdpBEGIN { trace(mutex_type_adaptive(&`pidlock)); }
40*2870SdpBEGIN { trace(mutex_type_spin(&`pidlock)); }
41*2870Sdp
42*2870SdpBEGIN { trace(rw_read_held(&`ksyms_lock)); }
43*2870SdpBEGIN { trace(rw_write_held(&`ksyms_lock)); }
44*2870SdpBEGIN { trace(rw_iswriter(&`ksyms_lock)); }
45*2870Sdp
46*2870SdpBEGIN { x = alloca(10); bcopy(`initname, x, 10); trace(stringof(x)); }
47*2870Sdp/* We have no reliable way to test msgsize */
48*2870Sdp
49*2870SdpBEGIN { trace(strlen(`initname)); }
50*2870SdpBEGIN { trace(strchr(`initname, 0x69)); }
51*2870SdpBEGIN { trace(strrchr(`initname, 0x69)); }
52*2870SdpBEGIN { trace(strstr("/sbin/init/foo", `initname)); }
53*2870SdpBEGIN { trace(strstr(`initname, "in")); }
54*2870SdpBEGIN { trace(strtok(`initname, "/")); }
55*2870SdpBEGIN { trace(strtok(NULL, "/")); }
56*2870SdpBEGIN { trace(strtok("foo/bar", `initname)); }
57*2870SdpBEGIN { trace(strtok(NULL, `initname)); }
58*2870SdpBEGIN { trace(substr(`initname, 2, 3)); }
59*2870Sdp
60*2870SdpBEGIN { trace(ddi_pathname(`top_devinfo, 1)); }
61*2870SdpBEGIN { trace(strjoin(`initname, "foo")); }
62*2870SdpBEGIN { trace(strjoin("foo", `initname)); }
63*2870SdpBEGIN { trace(dirname(`initname)); }
64*2870SdpBEGIN { trace(cleanpath(`initname)); }
65*2870Sdp
66*2870SdpERROR {
67*2870Sdp	errorcount++;
68*2870Sdp}
69*2870Sdp
70*2870SdpBEGIN /errorcount == expected_errorcount/ {
71*2870Sdp	trace("test passed");
72*2870Sdp	exit(0);
73*2870Sdp}
74*2870Sdp
75*2870SdpBEGIN /errorcount != expected_errorcount/ {
76*2870Sdp	printf("fail: expected %d.  saw %d.", expected_errorcount, errorcount);
77*2870Sdp	exit(1);
78*2870Sdp}
79*2870SdpEOF
80*2870Sdp
81*2870Sdp
82*2870Sdpexit $?
83