Home | History | Annotate | Download | only in usdt
      1  4273  ahl #!/usr/bin/ksh
      2  4273  ahl #
      3  4273  ahl # CDDL HEADER START
      4  4273  ahl #
      5  4273  ahl # The contents of this file are subject to the terms of the
      6  4273  ahl # Common Development and Distribution License (the "License").
      7  4273  ahl # You may not use this file except in compliance with the License.
      8  4273  ahl #
      9  4273  ahl # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10  4273  ahl # or http://www.opensolaris.org/os/licensing.
     11  4273  ahl # See the License for the specific language governing permissions
     12  4273  ahl # and limitations under the License.
     13  4273  ahl #
     14  4273  ahl # When distributing Covered Code, include this CDDL HEADER in each
     15  4273  ahl # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  4273  ahl # If applicable, add the following below this CDDL HEADER, with the
     17  4273  ahl # fields enclosed by brackets "[]" replaced with your own identifying
     18  4273  ahl # information: Portions Copyright [yyyy] [name of copyright owner]
     19  4273  ahl #
     20  4273  ahl # CDDL HEADER END
     21  4273  ahl #
     22  4273  ahl 
     23  4273  ahl #
     24  4273  ahl # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     25  4273  ahl # Use is subject to license terms.
     26  4273  ahl #
     27  4273  ahl # ident	"%Z%%M%	%I%	%E% SMI"
     28  4273  ahl #
     29  4273  ahl 
     30  4273  ahl if [ $# != 1 ]; then
     31  4273  ahl 	echo expected one argument: '<'dtrace-path'>'
     32  4273  ahl 	exit 2
     33  4273  ahl fi
     34  4273  ahl 
     35  4273  ahl dtrace=$1
     36  4273  ahl 
     37  4273  ahl #
     38  4273  ahl # Test that we don't deadlock between forking and enabling/disabling USDT
     39  4273  ahl # probes. This test has succeeded if it completes at all.
     40  4273  ahl #
     41  4273  ahl 
     42  4273  ahl ./tst.forker.exe &
     43  4273  ahl id=$!
     44  4273  ahl 
     45  4273  ahl while kill -0 $id >/dev/null 2>&1; do
     46  4821  ahl 	$dtrace -p $id -s /dev/stdin <<-EOF
     47  4273  ahl 		forker*:::fire
     48  4273  ahl 		/i++ == 4/
     49  4273  ahl 		{
     50  4273  ahl 			exit(0);
     51  4273  ahl 		}
     52  4273  ahl 	EOF
     53  4273  ahl done
     54  4273  ahl 
     55  4273  ahl exit 0
     56