xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/misc/tst.roch.d (revision 73b80b821da76082173547dd650e417f6916eb8b)
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 /*
28  * ASSERTION: test for assertion failure in the ring buffer code
29  *
30  * SECTION: Buffers and Buffering/ring Policy; Misc
31  */
32 
33 /*
34  * A script from Roch Bourbonnais that induced an assertion failure in the
35  * ring buffer code.
36  */
37 #pragma D option strsize=16
38 #pragma D option bufsize=10K
39 #pragma D option bufpolicy=ring
40 
41 fbt:::entry
42 /(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
43 {
44 	self->done = 1;
45 	printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
46 	    (long long)curthread, pid, tid,
47 	    execname, (long long)stackdepth);
48 	stack(20);
49 }
50 
51 fbt:::return
52 /(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
53 {
54 	self->done = 1;
55 	printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
56 	    (long long) curthread, pid, tid,
57 	    execname, (long long) stackdepth);
58 	stack(20);
59 }
60 
61 fbt:::entry
62 {
63 	printf(" %u 0x%llX %d %d ", timestamp,
64 	    (long long)curthread, pid, tid);
65 }
66 
67 fbt:::return
68 {
69 	printf(" %u 0x%llX %d %d tag:%d off:%d ", timestamp,
70 	    (long long)curthread, pid, tid, (int)arg1, (int)arg0);
71 }
72 
73 mutex_enter:adaptive-acquire
74 {
75 	printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
76 	    (long long)curthread, pid, tid, arg0);
77 }
78 
79 mutex_exit:adaptive-release
80 {
81 	printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
82 	    (long long) curthread, pid, tid, arg0);
83 }
84 
85 tick-1sec
86 /n++ == 10/
87 {
88 	exit(0);
89 }
90