1178476Sjb/* 2178476Sjb * CDDL HEADER START 3178476Sjb * 4178476Sjb * The contents of this file are subject to the terms of the 5178476Sjb * Common Development and Distribution License (the "License"). 6178476Sjb * You may not use this file except in compliance with the License. 7178476Sjb * 8178476Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9178476Sjb * or http://www.opensolaris.org/os/licensing. 10178476Sjb * See the License for the specific language governing permissions 11178476Sjb * and limitations under the License. 12178476Sjb * 13178476Sjb * When distributing Covered Code, include this CDDL HEADER in each 14178476Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15178476Sjb * If applicable, add the following below this CDDL HEADER, with the 16178476Sjb * fields enclosed by brackets "[]" replaced with your own identifying 17178476Sjb * information: Portions Copyright [yyyy] [name of copyright owner] 18178476Sjb * 19178476Sjb * CDDL HEADER END 20178476Sjb */ 21178476Sjb 22178476Sjb/* 23178476Sjb * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24178476Sjb * Use is subject to license terms. 25178476Sjb */ 26256002Spfg/* 27256002Spfg * Copyright (c) 2012 by Delphix. All rights reserved. 28256002Spfg */ 29178476Sjb 30178476Sjb/* 31178476Sjb * ASSERTION: 32178476Sjb * Positive test for fill buffer policy. 33178476Sjb * 34178476Sjb * SECTION: Buffers and Buffering/fill Policy; 35256002Spfg * Buffers and Buffering/Buffer Sizes; 36178476Sjb * Options and Tunables/bufsize; 37178476Sjb * Options and Tunables/bufpolicy; 38178476Sjb * Options and Tunables/statusrate 39178476Sjb */ 40178476Sjb/* 41256002Spfg * This is a brute-force way of testing fill buffers. We assume that 42256002Spfg * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp 43256002Spfg * lo, timestamp hi, and the variable i). Because each fill buffer is 44256002Spfg * per-CPU, we must fill up our buffer in one series of enablings on a 45256002Spfg * single CPU. 46178476Sjb */ 47178476Sjb#pragma D option bufpolicy=fill 48256002Spfg#pragma D option bufsize=128 49178476Sjb#pragma D option statusrate=10ms 50178476Sjb#pragma D option quiet 51178476Sjb 52178476Sjbint i; 53178476Sjb 54178476Sjbtick-10ms 55178476Sjb{ 56178476Sjb printf("%d\n", i++); 57178476Sjb} 58178476Sjb 59178476Sjbtick-10ms 60178476Sjb{ 61178476Sjb printf("%d\n", i++); 62178476Sjb} 63178476Sjb 64178476Sjbtick-10ms 65178476Sjb{ 66178476Sjb printf("%d\n", i++); 67178476Sjb} 68178476Sjb 69178476Sjbtick-10ms 70178476Sjb{ 71178476Sjb printf("%d\n", i++); 72178476Sjb} 73178476Sjb 74178476Sjbtick-10ms 75178476Sjb{ 76178476Sjb printf("%d\n", i++); 77178476Sjb} 78178476Sjb 79178476Sjbtick-10ms 80178476Sjb{ 81178476Sjb printf("%d\n", i++); 82178476Sjb} 83178476Sjb 84178476Sjbtick-10ms 85178476Sjb{ 86178476Sjb printf("%d\n", i++); 87178476Sjb} 88178476Sjb 89178476Sjbtick-10ms 90178476Sjb{ 91178476Sjb printf("%d\n", i++); 92178476Sjb} 93178476Sjb 94178476Sjbtick-10ms 95178476Sjb{ 96178476Sjb printf("%d\n", i++); 97178476Sjb} 98178476Sjb 99178476Sjbtick-10ms 100178476Sjb{ 101178476Sjb printf("%d\n", i++); 102178476Sjb} 103178476Sjb 104178476Sjbtick-10ms 105178476Sjb{ 106178476Sjb printf("%d\n", i++); 107178476Sjb} 108178476Sjb 109178476Sjbtick-10ms 110178476Sjb{ 111178476Sjb printf("%d\n", i++); 112178476Sjb} 113178476Sjb 114178476Sjbtick-10ms 115178476Sjb/i >= 100/ 116178476Sjb{ 117178476Sjb exit(1); 118178476Sjb} 119