err.D_AGG_SPEC.SpeculateWithLquant.d revision 178477
1132718Skan/* 2169689Skan * CDDL HEADER START 3132718Skan * 4132718Skan * The contents of this file are subject to the terms of the 5132718Skan * Common Development and Distribution License (the "License"). 6132718Skan * You may not use this file except in compliance with the License. 7132718Skan * 8132718Skan * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9132718Skan * or http://www.opensolaris.org/os/licensing. 10132718Skan * See the License for the specific language governing permissions 11132718Skan * and limitations under the License. 12132718Skan * 13132718Skan * When distributing Covered Code, include this CDDL HEADER in each 14132718Skan * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15132718Skan * If applicable, add the following below this CDDL HEADER, with the 16132718Skan * fields enclosed by brackets "[]" replaced with your own identifying 17132718Skan * information: Portions Copyright [yyyy] [name of copyright owner] 18132718Skan * 19169689Skan * CDDL HEADER END 20169689Skan */ 21132718Skan 22169689Skan/* 23169689Skan * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24169689Skan * Use is subject to license terms. 25169689Skan */ 26169689Skan 27169689Skan#pragma ident "%Z%%M% %I% %E% SMI" 28169689Skan 29132718Skan/* 30132718Skan * ASSERTION: 31132718Skan * Aggregating functions may never be speculative. 32132718Skan * 33132718Skan * SECTION: Speculative Tracing/Using a Speculation 34132718Skan * 35132718Skan */ 36132718Skan#pragma D option quiet 37132718Skan 38132718SkanBEGIN 39132718Skan{ 40132718Skan i = 0; 41132718Skan} 42132718Skan 43132718Skansyscall:::entry 44132718Skan{ 45132718Skan self->ts = timestamp; 46169689Skan} 47169689Skan 48169689Skansyscall:::return 49132718Skan/self->ts/ 50169689Skan{ 51169689Skan var = speculation(); 52169689Skan speculate(var); 53169689Skan printf("Speculation ID: %d", var); 54169689Skan @Lqauntus[execname] = lquantize(timestamp - self->ts, 0, 100, 1); 55169689Skan i++; 56132718Skan} 57132718Skan 58132718Skansyscall::: 59132718Skan/1 == i/ 60132718Skan{ 61132718Skan exit(0); 62132718Skan} 63132718Skan 64132718SkanERROR 65132718Skan{ 66132718Skan exit(0); 67132718Skan} 68132718Skan 69132718SkanEND 70132718Skan{ 71132718Skan exit(0); 72132718Skan} 73132718Skan