xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/proc/tst.create.ksh (revision 4926:0c0bcae7290e)
12633Sahl#
22633Sahl# CDDL HEADER START
32633Sahl#
42633Sahl# The contents of this file are subject to the terms of the
52633Sahl# Common Development and Distribution License (the "License").
62633Sahl# You may not use this file except in compliance with the License.
72633Sahl#
82633Sahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92633Sahl# or http://www.opensolaris.org/os/licensing.
102633Sahl# See the License for the specific language governing permissions
112633Sahl# and limitations under the License.
122633Sahl#
132633Sahl# When distributing Covered Code, include this CDDL HEADER in each
142633Sahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152633Sahl# If applicable, add the following below this CDDL HEADER, with the
162633Sahl# fields enclosed by brackets "[]" replaced with your own identifying
172633Sahl# information: Portions Copyright [yyyy] [name of copyright owner]
182633Sahl#
192633Sahl# CDDL HEADER END
202633Sahl#
212633Sahl
222633Sahl#
23*4926Sjhaslam# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
242633Sahl# Use is subject to license terms.
252633Sahl#
26*4926Sjhaslam# ident	"%Z%%M%	%I%	%E% SMI"
272633Sahl
282633Sahl#
292633Sahl# This script tests that the proc:::create probe fires with the proper
302633Sahl# arguments.
312633Sahl#
322633Sahl# If this fails, the script will run indefinitely; it relies on the harness
332633Sahl# to time it out.
342633Sahl#
352633Sahlscript()
362633Sahl{
372633Sahl	$dtrace -s /dev/stdin <<EOF
382633Sahl	proc:::create
392633Sahl	/args[0]->pr_ppid == $child && pid == $child/
402633Sahl	{
412633Sahl		exit(0);
422633Sahl	}
432633SahlEOF
442633Sahl}
452633Sahl
462633Sahlsleeper()
472633Sahl{
482633Sahl	while true; do
492633Sahl		/usr/bin/sleep 1
502633Sahl	done
512633Sahl}
522633Sahl
532804Stomeeif [ $# != 1 ]; then
542804Stomee	echo expected one argument: '<'dtrace-path'>'
552804Stomee	exit 2
562804Stomeefi
572804Stomee
582804Stomeedtrace=$1
592633Sahl
602633Sahlsleeper &
612633Sahlchild=$!
622633Sahl
632633Sahlscript
642633Sahlstatus=$?
652633Sahl
662633Sahlkill $child
672633Sahlexit $status
68