err.D_ACT_SPEC.SpeculateWithStop.d revision 9512fe850e98fdd448c638ca63fdd92a8a510255
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major#!/usr/sbin/dtrace -ws
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major/*
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * CDDL HEADER START
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major *
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * The contents of this file are subject to the terms of the
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * Common Development and Distribution License (the "License").
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * You may not use this file except in compliance with the License.
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major *
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * or http://www.opensolaris.org/os/licensing.
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * See the License for the specific language governing permissions
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * and limitations under the License.
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major *
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * When distributing Covered Code, include this CDDL HEADER in each
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * If applicable, add the following below this CDDL HEADER, with the
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * fields enclosed by brackets "[]" replaced with your own identifying
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * information: Portions Copyright [yyyy] [name of copyright owner]
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major *
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major * CDDL HEADER END
ca66273b61a8889f097081b01b6ff9a5f5801064Peter Major */
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ASSERTION:
* Destructive actions may never be speculative.
*
* SECTION: Speculative Tracing/Using a Speculation
* SECTION: dtrace(1M) Utility/ -w option
*/
#pragma D option quiet
BEGIN
{
i = 0;
}
profile:::tick-1sec
/i < 1/
{
var = speculation();
speculate(var);
printf("Speculation ID: %d", var);
stop();
i++;
}
profile:::tick-1sec
/1 == i/
{
exit(0);
}
ERROR
{
exit(0);
}
END
{
exit(0);
}