12633Sahl /*
22633Sahl  * CDDL HEADER START
32633Sahl  *
42633Sahl  * The contents of this file are subject to the terms of the
52633Sahl  * Common Development and Distribution License (the "License").
62633Sahl  * You may not use this file except in compliance with the License.
72633Sahl  *
82633Sahl  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92633Sahl  * or http://www.opensolaris.org/os/licensing.
102633Sahl  * See the License for the specific language governing permissions
112633Sahl  * and limitations under the License.
122633Sahl  *
132633Sahl  * When distributing Covered Code, include this CDDL HEADER in each
142633Sahl  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152633Sahl  * If applicable, add the following below this CDDL HEADER, with the
162633Sahl  * fields enclosed by brackets "[]" replaced with your own identifying
172633Sahl  * information: Portions Copyright [yyyy] [name of copyright owner]
182633Sahl  *
192633Sahl  * CDDL HEADER END
202633Sahl  */
212633Sahl 
222633Sahl /*
23*4926Sjhaslam  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
242633Sahl  * Use is subject to license terms.
252633Sahl  */
262633Sahl 
272633Sahl #pragma ident	"%Z%%M%	%I%	%E% SMI"
282633Sahl 
292633Sahl /*
302633Sahl  * ASSERTION:
312633Sahl  * Data recording actions may follow discard.
322633Sahl  *
332633Sahl  * SECTION: Speculative Tracing/Discarding a Speculation;
342633Sahl  *	Options and Tunables/cleanrate
352633Sahl  */
362633Sahl #pragma D option quiet
37*4926Sjhaslam #pragma D option cleanrate=2000hz
382633Sahl 
392633Sahl BEGIN
402633Sahl {
412633Sahl 	self->speculateFlag = 0;
422633Sahl 	self->discardFlag = 0;
432633Sahl 	self->spec = speculation();
442633Sahl }
452633Sahl 
462633Sahl BEGIN
472633Sahl /self->spec/
482633Sahl {
492633Sahl 	speculate(self->spec);
502633Sahl 	printf("Called speculate with id: %d\n", self->spec);
512633Sahl 	self->speculateFlag++;
522633Sahl }
532633Sahl 
542633Sahl BEGIN
552633Sahl /(self->spec) && (self->speculateFlag)/
562633Sahl {
572633Sahl 	discard(self->spec);
582633Sahl 	self->discardFlag++;
592633Sahl 	printf("Data recording after discard\n");
602633Sahl }
612633Sahl 
622633Sahl BEGIN
632633Sahl /self->discardFlag/
642633Sahl {
652633Sahl 	exit(0);
662633Sahl }
672633Sahl 
682633Sahl BEGIN
692633Sahl /!self->discardFlag/
702633Sahl {
712633Sahl 	exit(1);
722633Sahl }
732633Sahl 
742633Sahl ERROR
752633Sahl {
762633Sahl 	exit(1);
772633Sahl }
78