xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/misc/tst.roch.d (revision 89b2a9fbeabf42fa54594df0e5927bcc50a07cc9)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * ASSERTION: test for assertion failure in the ring buffer code
31  *
32  * SECTION: Buffers and Buffering/ring Policy; Misc
33  */
34 
35 #pragma ident	"@(#)tst.roch.d	1.2	03/08/11 SMI"
36 
37 /*
38  * A script from Roch Bourbonnais that induced an assertion failure in the
39  * ring buffer code.
40  */
41 #pragma D option strsize=16
42 #pragma D option bufsize=10K
43 #pragma D option bufpolicy=ring
44 
45 fbt:::entry
46 /(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
47 {
48 	self->done = 1;
49 	printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
50 	    (long long)curthread, pid, tid,
51 	    execname, (long long)stackdepth);
52 	stack(20);
53 }
54 
55 fbt:::return
56 /(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
57 {
58 	self->done = 1;
59 	printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
60 	    (long long) curthread, pid, tid,
61 	    execname, (long long) stackdepth);
62 	stack(20);
63 }
64 
65 fbt:::entry
66 {
67 	printf(" %u 0x%llX %d %d ", timestamp,
68 	    (long long)curthread, pid, tid);
69 }
70 
71 fbt:::return
72 {
73 	printf(" %u 0x%llX %d %d tag:%d off:%d ", timestamp,
74 	    (long long)curthread, pid, tid, (int)arg1, (int)arg0);
75 }
76 
77 mutex_enter:adaptive-acquire
78 {
79 	printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
80 	    (long long)curthread, pid, tid, arg0);
81 }
82 
83 mutex_exit:adaptive-release
84 {
85 	printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
86 	    (long long) curthread, pid, tid, arg0);
87 }
88 
89 tick-1sec
90 /n++ == 10/
91 {
92 	exit(0);
93 }
94