1178476Sjb# 2178476Sjb# CDDL HEADER START 3178476Sjb# 4178476Sjb# The contents of this file are subject to the terms of the 5178476Sjb# Common Development and Distribution License (the "License"). 6178476Sjb# You may not use this file except in compliance with the License. 7178476Sjb# 8178476Sjb# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9178476Sjb# or http://www.opensolaris.org/os/licensing. 10178476Sjb# See the License for the specific language governing permissions 11178476Sjb# and limitations under the License. 12178476Sjb# 13178476Sjb# When distributing Covered Code, include this CDDL HEADER in each 14178476Sjb# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15178476Sjb# If applicable, add the following below this CDDL HEADER, with the 16178476Sjb# fields enclosed by brackets "[]" replaced with your own identifying 17178476Sjb# information: Portions Copyright [yyyy] [name of copyright owner] 18178476Sjb# 19178476Sjb# CDDL HEADER END 20178476Sjb# 21178476Sjb 22178476Sjb# 23178476Sjb# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24178476Sjb# Use is subject to license terms. 25178476Sjb# 26178476Sjb#ident "%Z%%M% %I% %E% SMI" 27178476Sjb 28178476Sjbppriv -s A=basic,dtrace_proc,dtrace_user $$ 29178476Sjb 30178476Sjb/usr/sbin/dtrace -q -s /dev/stdin <<"EOF" 31178476Sjb 32178476SjbBEGIN { 33178476Sjb errorcount = 0; 34178476Sjb expected_errorcount = 23; 35178476Sjb} 36178476Sjb 37178476SjbBEGIN { trace(mutex_owned(&`pidlock)); } 38178476SjbBEGIN { trace(mutex_owner(&`pidlock)); } 39178476SjbBEGIN { trace(mutex_type_adaptive(&`pidlock)); } 40178476SjbBEGIN { trace(mutex_type_spin(&`pidlock)); } 41178476Sjb 42178476SjbBEGIN { trace(rw_read_held(&`ksyms_lock)); } 43178476SjbBEGIN { trace(rw_write_held(&`ksyms_lock)); } 44178476SjbBEGIN { trace(rw_iswriter(&`ksyms_lock)); } 45178476Sjb 46178476SjbBEGIN { x = alloca(10); bcopy(`initname, x, 10); trace(stringof(x)); } 47178476Sjb/* We have no reliable way to test msgsize */ 48178476Sjb 49178476SjbBEGIN { trace(strlen(`initname)); } 50178476SjbBEGIN { trace(strchr(`initname, 0x69)); } 51178476SjbBEGIN { trace(strrchr(`initname, 0x69)); } 52178476SjbBEGIN { trace(strstr("/sbin/init/foo", `initname)); } 53178476SjbBEGIN { trace(strstr(`initname, "in")); } 54178476SjbBEGIN { trace(strtok(`initname, "/")); } 55178476SjbBEGIN { trace(strtok(NULL, "/")); } 56178476SjbBEGIN { trace(strtok("foo/bar", `initname)); } 57178476SjbBEGIN { trace(strtok(NULL, `initname)); } 58178476SjbBEGIN { trace(substr(`initname, 2, 3)); } 59178476Sjb 60178476SjbBEGIN { trace(ddi_pathname(`top_devinfo, 1)); } 61178476SjbBEGIN { trace(strjoin(`initname, "foo")); } 62178476SjbBEGIN { trace(strjoin("foo", `initname)); } 63178476SjbBEGIN { trace(dirname(`initname)); } 64178476SjbBEGIN { trace(cleanpath(`initname)); } 65178476Sjb 66178476SjbERROR { 67178476Sjb errorcount++; 68178476Sjb} 69178476Sjb 70178476SjbBEGIN /errorcount == expected_errorcount/ { 71178476Sjb trace("test passed"); 72178476Sjb exit(0); 73178476Sjb} 74178476Sjb 75178476SjbBEGIN /errorcount != expected_errorcount/ { 76178476Sjb printf("fail: expected %d. saw %d.", expected_errorcount, errorcount); 77178476Sjb exit(1); 78178476Sjb} 79178476SjbEOF 80178476Sjb 81178476Sjb 82178476Sjbexit $? 83