xref: /src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.d (revision 2be1a816b9ff69588e55be0a84cbe2a31efc0f2f)
112456ea8SJohn Birrell /*
212456ea8SJohn Birrell  * CDDL HEADER START
312456ea8SJohn Birrell  *
412456ea8SJohn Birrell  * The contents of this file are subject to the terms of the
512456ea8SJohn Birrell  * Common Development and Distribution License (the "License").
612456ea8SJohn Birrell  * You may not use this file except in compliance with the License.
712456ea8SJohn Birrell  *
812456ea8SJohn Birrell  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
912456ea8SJohn Birrell  * or http://www.opensolaris.org/os/licensing.
1012456ea8SJohn Birrell  * See the License for the specific language governing permissions
1112456ea8SJohn Birrell  * and limitations under the License.
1212456ea8SJohn Birrell  *
1312456ea8SJohn Birrell  * When distributing Covered Code, include this CDDL HEADER in each
1412456ea8SJohn Birrell  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1512456ea8SJohn Birrell  * If applicable, add the following below this CDDL HEADER, with the
1612456ea8SJohn Birrell  * fields enclosed by brackets "[]" replaced with your own identifying
1712456ea8SJohn Birrell  * information: Portions Copyright [yyyy] [name of copyright owner]
1812456ea8SJohn Birrell  *
1912456ea8SJohn Birrell  * CDDL HEADER END
2012456ea8SJohn Birrell  */
2112456ea8SJohn Birrell 
2212456ea8SJohn Birrell /*
2312456ea8SJohn Birrell  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2412456ea8SJohn Birrell  * Use is subject to license terms.
2512456ea8SJohn Birrell  */
2612456ea8SJohn Birrell 
2712456ea8SJohn Birrell #pragma ident	"%Z%%M%	%I%	%E% SMI"
2812456ea8SJohn Birrell 
2912456ea8SJohn Birrell /*
3012456ea8SJohn Birrell  * ASSERTION:
3112456ea8SJohn Birrell  *
3212456ea8SJohn Birrell  * SECTION:
3312456ea8SJohn Birrell  *
3412456ea8SJohn Birrell  * NOTES:
3512456ea8SJohn Birrell  *
3612456ea8SJohn Birrell  */
3712456ea8SJohn Birrell 
3812456ea8SJohn Birrell #pragma D option destructive
3912456ea8SJohn Birrell 
4012456ea8SJohn Birrell pid$1:a.out:waiting:entry
4112456ea8SJohn Birrell {
4212456ea8SJohn Birrell 	this->a = (char *)alloca(1);
4312456ea8SJohn Birrell 	*this->a = 1;
4412456ea8SJohn Birrell 	copyout(this->a, arg0, 1);
4512456ea8SJohn Birrell }
4612456ea8SJohn Birrell 
4712456ea8SJohn Birrell pid$1:a.out:main:,
4812456ea8SJohn Birrell pid$1:a.out:other:
4912456ea8SJohn Birrell {
5012456ea8SJohn Birrell }
5112456ea8SJohn Birrell 
5212456ea8SJohn Birrell pid$1:a.out:bad:entry
5312456ea8SJohn Birrell {
5412456ea8SJohn Birrell 	exit(1);
5512456ea8SJohn Birrell }
5612456ea8SJohn Birrell 
5712456ea8SJohn Birrell syscall::rexit:entry
5812456ea8SJohn Birrell /pid == $1/
5912456ea8SJohn Birrell {
6012456ea8SJohn Birrell 	exit(0);
6112456ea8SJohn Birrell }
6212456ea8SJohn Birrell 
6312456ea8SJohn Birrell 
6412456ea8SJohn Birrell BEGIN
6512456ea8SJohn Birrell {
6612456ea8SJohn Birrell 	/*
6712456ea8SJohn Birrell 	 * Let's just do this for 5 seconds.
6812456ea8SJohn Birrell 	 */
6912456ea8SJohn Birrell 	timeout = timestamp + 5000000000;
7012456ea8SJohn Birrell }
7112456ea8SJohn Birrell 
7212456ea8SJohn Birrell profile:::tick-4
7312456ea8SJohn Birrell /timestamp > timeout/
7412456ea8SJohn Birrell {
7512456ea8SJohn Birrell 	trace("test timed out");
7612456ea8SJohn Birrell 	exit(1);
7712456ea8SJohn Birrell }
7812456ea8SJohn Birrell 
79