9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * or http://www.opensolaris.org/os/licensing.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ASSERTION: test for assertion failure in the ring buffer code
9512fe850e98fdd448c638ca63fdd92a8a510255ahl *
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * SECTION: Buffers and Buffering/ring Policy; Misc
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "@(#)tst.roch.d 1.2 03/08/11 SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/*
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * A script from Roch Bourbonnais that induced an assertion failure in the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ring buffer code.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma D option strsize=16
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma D option bufsize=10K
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma D option bufpolicy=ring
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlfbt:::entry
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl self->done = 1;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl (long long)curthread, pid, tid,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl execname, (long long)stackdepth);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl stack(20);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlfbt:::return
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl self->done = 1;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl (long long) curthread, pid, tid,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl execname, (long long) stackdepth);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl stack(20);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlfbt:::entry
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf(" %u 0x%llX %d %d ", timestamp,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl (long long)curthread, pid, tid);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlfbt:::return
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf(" %u 0x%llX %d %d tag:%d off:%d ", timestamp,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl (long long)curthread, pid, tid, (int)arg1, (int)arg0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlmutex_enter:adaptive-acquire
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl (long long)curthread, pid, tid, arg0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlmutex_exit:adaptive-release
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl (long long) curthread, pid, tid, arg0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahltick-1sec
9512fe850e98fdd448c638ca63fdd92a8a510255ahl/n++ == 10/
9512fe850e98fdd448c638ca63fdd92a8a510255ahl{
9512fe850e98fdd448c638ca63fdd92a8a510255ahl exit(0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl}