tst.copyin.d revision 272461
1223637Sbz/* 2126258Smlaier * CDDL HEADER START 3126258Smlaier * 4126258Smlaier * The contents of this file are subject to the terms of the 5126258Smlaier * Common Development and Distribution License (the "License"). 6126258Smlaier * You may not use this file except in compliance with the License. 7126258Smlaier * 8126258Smlaier * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9126258Smlaier * or http://www.opensolaris.org/os/licensing. 10126258Smlaier * See the License for the specific language governing permissions 11126258Smlaier * and limitations under the License. 12126258Smlaier * 13126258Smlaier * When distributing Covered Code, include this CDDL HEADER in each 14126258Smlaier * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15126258Smlaier * If applicable, add the following below this CDDL HEADER, with the 16126258Smlaier * fields enclosed by brackets "[]" replaced with your own identifying 17126258Smlaier * information: Portions Copyright [yyyy] [name of copyright owner] 18126258Smlaier * 19126258Smlaier * CDDL HEADER END 20126258Smlaier */ 21126258Smlaier 22126258Smlaier/* 23126258Smlaier * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24126258Smlaier * Use is subject to license terms. 25126258Smlaier */ 26126258Smlaier 27126258Smlaier/* 28126258Smlaier * Copyright (c) 2012 by Delphix. All rights reserved. 29223637Sbz */ 30223637Sbz 31223637Sbz/* 32223637Sbz * ASSERTION: 33223637Sbz * We set our buffer size absurdly low to prevent a flood of errors that we 34223637Sbz * don't care about. We set our statusrate to be infinitely short to cause 35223637Sbz * lots of activity by the DTrace process. 36223637Sbz * 37223637Sbz * SECTION: Actions and Subroutines/copyin(); 38223637Sbz * Options and Tunables/bufsize; 39223637Sbz * Options and Tunables/bufpolicy; 40223637Sbz * Options and Tunables/statusrate 41223637Sbz */ 42223637Sbz 43223637Sbz 44223637Sbz#pragma D option bufsize=32 45127145Smlaier#pragma D option bufpolicy=ring 46126261Smlaier#pragma D option statusrate=1nsec 47126261Smlaier 48126261Smlaiersyscall:::entry 49126261Smlaier{ 50153110Sru n++; 51171168Smlaier trace(copyin(rand(), 1)); 52171168Smlaier} 53171168Smlaier 54153110Srusyscall:::entry 55127145Smlaier{ 56153110Sru trace(copyin(rand() | 1, 1)); 57153110Sru} 58153110Sru 59153110Srusyscall:::entry 60153110Sru{ 61127145Smlaier trace(copyin(NULL, 1)); 62153110Sru} 63153110Sru 64126261Smlaierdtrace:::ERROR 65126258Smlaier{ 66171168Smlaier err++; 67171168Smlaier} 68171168Smlaier 69171168Smlaiertick-1sec 70153110Sru/sec++ == 10/ 71171168Smlaier{ 72153110Sru exit(2); 73126258Smlaier} 74223637Sbz 75164033SrwatsonEND 76223637Sbz/n == 0 || err == 0/ 77223637Sbz{ 78164033Srwatson exit(1); 79164033Srwatson} 80130613Smlaier 81126258SmlaierEND 82126258Smlaier/n != 0 && err != 0/ 83126258Smlaier{ 84126258Smlaier exit(0); 85127145Smlaier} 86145836Smlaier