tst.statusrate.d revision 178477
1251876Speter/* 2251876Speter * CDDL HEADER START 3251876Speter * 4251876Speter * The contents of this file are subject to the terms of the 5251876Speter * Common Development and Distribution License (the "License"). 6251876Speter * You may not use this file except in compliance with the License. 7251876Speter * 8251876Speter * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9251876Speter * or http://www.opensolaris.org/os/licensing. 10251876Speter * See the License for the specific language governing permissions 11251876Speter * and limitations under the License. 12251876Speter * 13251876Speter * When distributing Covered Code, include this CDDL HEADER in each 14251876Speter * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15251876Speter * If applicable, add the following below this CDDL HEADER, with the 16251876Speter * fields enclosed by brackets "[]" replaced with your own identifying 17251876Speter * information: Portions Copyright [yyyy] [name of copyright owner] 18251876Speter * 19251876Speter * CDDL HEADER END 20251876Speter */ 21251876Speter 22251876Speter/* 23251876Speter * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24251876Speter * Use is subject to license terms. 25251876Speter */ 26251876Speter 27251876Speter#pragma ident "%Z%%M% %I% %E% SMI" 28251876Speter 29251876Speter/* 30251876Speter * ASSERTION: 31251876Speter * Positive test of statusrate option. 32251876Speter * 33251876Speter * SECTION: Options and Tunables/statusrate 34251876Speter */ 35251876Speter 36251876Speter/* 37251876Speter * Tests the statusrate option, by checking that the time delta between 38251876Speter * exit() and END is at least as long as mandated by the statusrate. 39251876Speter */ 40251876Speter 41251876Speter#pragma D option statusrate=10sec 42251876Speter 43251876Speterinline uint64_t NANOSEC = 1000000000; 44251876Speter 45251876Spetertick-1sec 46251876Speter/n++ > 5/ 47251876Speter{ 48251876Speter exit(2); 49251876Speter ts = timestamp; 50251876Speter} 51251876Speter 52251876SpeterEND 53251876Speter/(this->delta = timestamp - ts) > 2 * NANOSEC/ 54251876Speter{ 55251876Speter exit(0); 56251876Speter} 57251876Speter 58251876SpeterEND 59251876Speter/this->delta <= 2 * NANOSEC/ 60251876Speter{ 61251876Speter printf("delta between exit() and END (%u nanos) too small", 62251876Speter this->delta); 63251876Speter exit(1); 64251876Speter} 65251876Speter 66251876SpeterEND 67251876Speter/this->delta > 20 * NANOSEC/ 68251876Speter{ 69251876Speter printf("delta between exit() and END (%u nanos) too large", 70251876Speter this->delta); 71251876Speter exit(1); 72251876Speter} 73251876Speter