1 7946 Andrew # 2 7946 Andrew # CDDL HEADER START 3 7946 Andrew # 4 7946 Andrew # The contents of this file are subject to the terms of the 5 7946 Andrew # Common Development and Distribution License (the "License"). 6 7946 Andrew # You may not use this file except in compliance with the License. 7 7946 Andrew # 8 7946 Andrew # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 7946 Andrew # or http://www.opensolaris.org/os/licensing. 10 7946 Andrew # See the License for the specific language governing permissions 11 7946 Andrew # and limitations under the License. 12 7946 Andrew # 13 7946 Andrew # When distributing Covered Code, include this CDDL HEADER in each 14 7946 Andrew # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 7946 Andrew # If applicable, add the following below this CDDL HEADER, with the 16 7946 Andrew # fields enclosed by brackets "[]" replaced with your own identifying 17 7946 Andrew # information: Portions Copyright [yyyy] [name of copyright owner] 18 7946 Andrew # 19 7946 Andrew # CDDL HEADER END 20 7946 Andrew # 21 7946 Andrew # 22 7946 Andrew # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23 7946 Andrew # Use is subject to license terms. 24 7946 Andrew # 25 7946 Andrew # Creates a fileset with $nfiles empty files, then proceeds to open each one 26 7946 Andrew # and then close it. 27 7946 Andrew # 28 7946 Andrew set $dir=/tmp 29 7946 Andrew set $nfiles=50000 30 7946 Andrew set $meandirwidth=100 31 7946 Andrew set $nthreads=16 32 7946 Andrew 33 7946 Andrew define fileset name=bigfileset,path=$dir,size=0,entries=$nfiles,dirwidth=$meandirwidth,prealloc 34 7946 Andrew 35 7946 Andrew define process name=fileopen,instances=1 36 7946 Andrew { 37 7946 Andrew thread name=fileopener,memsize=1m,instances=$nthreads 38 7946 Andrew { 39 7946 Andrew flowop openfile name=open1,filesetname=bigfileset,fd=1 40 7946 Andrew flowop closefile name=close1,fd=1 41 7946 Andrew } 42 7946 Andrew } 43 7946 Andrew 44 7946 Andrew echo "Openfiles Version 1.0 personality successfully loaded" 45 7946 Andrew usage "Usage: set \$dir=<dir> defaults to $dir" 46 7946 Andrew usage " set \$meandirwidth=<size> defaults to $meandirwidth" 47 7946 Andrew usage " set \$nfiles=<value> defaults to $nfiles" 48 7946 Andrew usage " set \$nthreads=<value> defaults to $nthreads" 49 7946 Andrew usage "(sets mean dir width and dir depth is calculated as log (width, nfiles)" 50 7946 Andrew usage " " 51 7946 Andrew usage " run 60" 52