1#!/bin/sh
2#
3#
4# CDDL HEADER START
5#
6# The contents of this file are subject to the terms
7# of the Common Development and Distribution License
8# (the "License").  You may not use this file except
9# in compliance with the License.
10#
11# You can obtain a copy of the license at
12# src/OPENSOLARIS.LICENSE
13# or http://www.opensolaris.org/os/licensing.
14# See the License for the specific language governing
15# permissions and limitations under the License.
16#
17# When distributing Covered Code, include this CDDL
18# HEADER in each file and include the License file at
19# usr/src/OPENSOLARIS.LICENSE.  If applicable,
20# add the following below this CDDL HEADER, with the
21# fields enclosed by brackets "[]" replaced with your
22# own identifying information: Portions Copyright [yyyy]
23# [name of copyright owner]
24#
25# CDDL HEADER END
26#
27
28#
29# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
30# Use is subject to license terms.
31#
32
33
34# usage function - defines all the options that can be given to this script.
35function usage {
36	echo "Usage"
37	echo "$0 [-l] [-h] [name of test]"
38	echo "-l               : This option runs the lmbench tests along with the default libmicro tests."
39	echo "-h               : Help. This option displays information on how to run the script. "
40	echo "[name of test]   : This option runs only the test that is specified"
41	echo ""
42	echo "Examples"
43	echo "$0               : This is the defualt execution. This will run only the default libmicro tests."
44	echo "$0 -l            : This will run the lmbench tests too "
45	echo "$0 getppid       : This will run only the getppid tests"
46	exit
47	
48}
49
50if [ $# -eq 1 ]
51then 
52	lmbench=2    # to check if only a single test is to be run. e.g, ./bench.sh getppid
53else
54	lmbench=0    # to run the default libMicro tests, without the lmbench tests.
55fi
56
57while getopts "lh" OPT_LIST
58do
59	case $OPT_LIST in 
60		l) lmbench=1;;    # to run the libmicro tests including the lmbench tests.
61		h) usage;;
62		*) usage;;
63	esac
64done
65
66if [ -w / ]; then
67	#do nothing
68	echo "/ is mounted"
69else
70	echo "ERROR: the test requires that the / directory be read/writable, please mount using the command: 'mount -uw /' "
71	exit 1
72fi
73
74
75tattle="./tattle"
76
77bench_version=0.4.0
78libmicro_version=`$tattle -V`
79
80case $libmicro_version in
81$bench_version)
82	;;
83*)
84	echo "ERROR: libMicro version doesn't match 'bench' script version"
85	exit 1
86esac
87
88TMPROOT=/private/tmp/libmicro.$$
89VARROOT=/private/var/tmp/libmicro.$$
90mkdir -p $TMPROOT
91mkdir -p $VARROOT
92trap "rm -rf $TMPROOT $VARROOT && exit" 0 2
93
94TFILE=$TMPROOT/data
95IFILE=$TMPROOT/ifile
96TDIR1=$TMPROOT/0/1/2/3/4/5/6/7/8/9
97TDIR2=$TMPROOT/1/2/3/4/5/6/7/8/9/0
98VFILE=$VARROOT/data
99VDIR1=$VARROOT/0/1/2/3/4/5/6/7/8/9
100VDIR2=$VARROOT/1/2/3/4/5/6/7/8/9/0
101
102
103OPTS="-E -C 200 -L -S -W"
104
105dd if=/dev/zero of=$TFILE bs=1024k count=10 2>/dev/null
106dd if=/dev/zero of=$VFILE bs=1024k count=10 2>/dev/null
107mkdir -p $TDIR1 $TDIR2
108mkdir -p $VDIR1 $VDIR2
109
110touch $IFILE
111/usr/bin/touch /private/var/tmp/lmbench
112
113
114# produce benchmark header for easier comparisons
115
116hostname=`uname -n`
117
118if [ -f /usr/sbin/psrinfo ]; then
119	p_count=`psrinfo|wc -l`
120	p_mhz=`psrinfo -v | awk '/operates/{print $6 "MHz"; exit }'`
121	p_type=`psrinfo -vp 2>/dev/null | awk '{if (NR == 3) {print $0; exit}}'` 
122	p_ipaddr=`getent hosts $hostname | awk '{print $1}'`
123fi
124
125if [ -f /proc/cpuinfo ]; then
126	p_count=`egrep processor /proc/cpuinfo | wc -l`
127	p_mhz=`awk -F: '/cpu MHz/{printf("%5.0f00Mhz\n",$2/100); exit}' /proc/cpuinfo`
128	p_type=`awk -F: '/model name/{print $2; exit}' /proc/cpuinfo`
129	p_ipaddr=`getent hosts $hostname | awk '{print $1}'`
130else
131## Mac OS X specific stuff
132# first, get ugly output, in case pretty output isn't available
133#
134	p_count=`sysctl -n hw.physicalcpu`
135	p_mhz=`sysctl -n hw.cpufrequency`
136	p_type=`sysctl -n hw.model`
137
138if [ -x /usr/sbin/system_profiler ]; then
139	# <rdar://4655981> requires this hunk of work-around
140	# grep the XML for the characteristic we need. The key appears twice, so grep for the useful key (with 'string')
141	# use sed to strip off the <string></string> and the tabs in front of the string.  So much work for so little result.
142	#
143		p_mhz=`system_profiler -xml -detailLevel mini SPHardwareDataType | \
144			grep -A1 current_processor_speed | grep string | \
145			sed -E 's/<string>(.+)<\/string>/\1/' | sed 's-	--g'`
146		p_type=`system_profiler -xml -detailLevel mini SPHardwareDataType | \
147			grep -A1 cpu_type | grep string | \
148			sed -E 's/<string>(.+)<\/string>/\1/' | sed 's-	--g'`
149fi
150
151# look for en0 (usually ethernet) if that isn't there try en1 (usually wireless) else give up
152	p_ipaddr=`ipconfig getpacket en0 | grep yiaddr | tr "= " "\n" | grep [0-9]`
153	if [ ! $p_ipaddr  ]; then
154		p_ipaddr=`ipconfig getpacket en1 | grep yiaddr | tr "= " "\n" | grep [0-9]`
155	elif [ ! $p_ipaddr ]; then
156		p_ipaddr="unknown"
157	fi
158fi
159
160printf "\n\n!Libmicro_#:   %30s\n" $libmicro_version
161printf "!Options:      %30s\n" "$OPTS"
162printf "!Machine_name: %30s\n" "$hostname"
163printf "!OS_name:      %30s\n" `uname -s`
164printf "!OS_release:   %30s\n" `sw_vers -productVersion`
165printf "!OS_build:     %30.18s\n" "`sw_vers -buildVersion`"
166printf "!Processor:    %30s\n" `arch`
167printf "!#CPUs:        %30s\n" $p_count
168printf "!CPU_MHz:      %30s\n" "$p_mhz"
169printf "!CPU_NAME:     %30s\n" "$p_type"
170printf "!IP_address:   %30s\n" "$p_ipaddr"
171printf "!Run_by:       %30s\n" $LOGNAME
172printf "!Date:	       %30s\n" "`date '+%D %R'`"
173printf "!Compiler:     %30s\n" `$tattle -c`
174printf "!Compiler Ver.:%30s\n" "`$tattle -v`"
175printf "!sizeof(long): %30s\n" `$tattle -s`
176printf "!extra_CFLAGS: %30s\n" "`$tattle -f`"
177printf "!TimerRes:     %30s\n\n\n" "`$tattle -r`"
178 
179bin_dir="$TMPROOT/bin"
180
181mkdir -p $bin_dir
182cp bin-*/exec_bin $bin_dir/$A
183
184cp ./apple/bin-*/posix_spawn_bin $bin_dir/$A
185
186newline=0
187
188#
189# Everything below the while loop is input for the while loop
190# if you have any tests which can't run in the while loop, put
191# them above this comment
192#
193while read A B
194do
195	# $A contains the command, $B contains the arguments
196	# we echo blank lines and comments
197	# we skip anything which fails to match *$1* (useful
198	# if we only want to test one case, but a nasty hack)
199
200	case $A in
201	\#*)
202		echo "$A $B"
203		newline=1
204		continue
205		;;
206	
207	"")
208		if [ $newline -eq 1 ]
209		then
210			newline=0
211			echo
212			echo
213		fi
214
215		continue
216		;;
217
218	*$1*)
219		# Default execution without the lmbench tests. 
220		# checks if there is no argument passed by the user.
221		if [  $lmbench -eq 0 ]
222		then
223			string=lmbench
224			if [ "${A:0:7}" == "$string" ]
225			then
226				continue
227			fi
228		fi
229			
230		;;
231	
232	*)		
233		if [ $lmbench -ne 1 ]
234		then
235			continue
236		fi
237		;;
238	esac
239
240	if [ ! -f $bin_dir/$A ]
241	then
242		cp bin-*/$A $bin_dir/$A
243	fi
244
245	echo
246
247	(cd $TMPROOT && eval "bin/$A $B")
248
249	echo
250	echo
251done <<.
252
253#
254# Obligatory null system call: use very short time
255# for default since SuSe implements this "syscall" in userland
256#
257
258getpid		$OPTS -N "getpid" -I 5
259getppid		$OPTS -N "getppid" -I 5
260
261getenv		$OPTS -N "getenv"	-s 100 -I 100	 
262getenv		$OPTS -N "getenvT2"	-s 100 -I 100	-T 2 
263
264gettimeofday	$OPTS -N "gettimeofday"          
265
266log		$OPTS -N "log"	-I 20	-B 300000	 
267exp		$OPTS -N "exp"	-I 20	-B 100000	 
268lrand48		$OPTS -N "lrand48"
269
270memset		$OPTS -N "memset_10"	-s 10	-I 10 
271memset		$OPTS -N "memset_256"	-s 256	-I 20
272memset		$OPTS -N "memset_256_u"	-s 256	 -a 1 -I 20 
273memset		$OPTS -N "memset_1k"	-s 1k	 -I 100 -B 2000
274memset		$OPTS -N "memset_4k"    -s 4k    -I 250 -B 500
275memset		$OPTS -N "memset_4k_uc" -s 4k    -u -I 400
276
277memset		$OPTS -N "memset_10k"	-s 10k	-I 600 -B 500
278memset		$OPTS -N "memset_1m"	-s 1m	-I 200000
279memset		$OPTS -N "memset_10m"	-s 10m -I 2000000 
280memset		$OPTS -N "memsetP2_10m"	-s 10m -P 2 -I 2000000 
281
282memrand		$OPTS -N "memrand"	-s 40m -B 10000
283
284# This is an elided test and is not ported yet.
285# Check Makefile.darwin for list of elided tests  
286# cachetocache	$OPTS -N "cachetocache" -s 100k -T 2 -I 200
287
288isatty		$OPTS -N "isatty_yes"   
289isatty		$OPTS -N "isatty_no"  -f $IFILE
290
291malloc		$OPTS -N "malloc_10"    -s 10    -g 10 -I 50
292malloc		$OPTS -N "malloc_100"   -s 100   -g 10 -I 50
293malloc		$OPTS -N "malloc_1k"    -s 1k    -g 10 -I 50
294malloc		$OPTS -N "malloc_10k"   -s 10k   -g 10 -I 50
295malloc		$OPTS -N "malloc_100k"  -s 100k  -g 10 -I 2000
296
297malloc		$OPTS -N "mallocT2_10"    -s 10   -g 10 -T 2 -I 200
298malloc		$OPTS -N "mallocT2_100"   -s 100  -g 10 -T 2 -I 200
299malloc		$OPTS -N "mallocT2_1k"    -s 1k   -g 10 -T 2 -I 200
300malloc		$OPTS -N "mallocT2_10k"   -s 10k  -g 10 -T 2 -I 200
301malloc		$OPTS -N "mallocT2_100k"  -s 100k -g 10 -T 2 -I 10000
302
303close		$OPTS -N "close_bad"		-B 96		-b
304close		$OPTS -N "close_tmp"		-B 64		-f $TFILE
305close		$OPTS -N "close_usr"		-B 64		-f $VFILE
306close		$OPTS -N "close_zero"		-B 64		-f /dev/zero
307close_tcp	$OPTS -N "close_tcp"		-B 32  
308
309memcpy		$OPTS -N "memcpy_10"	-s 10	-I 10 
310memcpy		$OPTS -N "memcpy_1k"	-s 1k	-I 50
311memcpy		$OPTS -N "memcpy_10k"	-s 10k	-I 800
312memcpy		$OPTS -N "memcpy_1m"	-s 1m   -I 500000
313memcpy		$OPTS -N "memcpy_10m"	-s 10m  -I 5000000
314
315strcpy		$OPTS -N "strcpy_10"	-s 10   -I 5 
316strcpy		$OPTS -N "strcpy_1k"	-s 1k   -I 100
317
318strlen		$OPTS -N "strlen_10"	-s 10   -I 5
319strlen		$OPTS -N "strlen_1k"	-s 1k   -I 100
320
321strchr		$OPTS -N "strchr_10"	-s 10   -I 5
322strchr		$OPTS -N "strchr_1k"	-s 1k   -I 200
323strcmp		$OPTS -N "strcmp_10"	-s 10   -I 10
324strcmp		$OPTS -N "strcmp_1k"	-s 1k   -I 200
325
326strcasecmp	$OPTS -N "scasecmp_10"	-s 10 -I 50 -B 2000
327strcasecmp	$OPTS -N "scasecmp_1k"	-s 1k -I 20000 -B 100
328
329strtol		$OPTS -N "strtol"      -I 20      
330
331# This is an elided test and is not ported yet.     
332# Check Makefile.darwin for list of elided tests
333# getcontext	$OPTS -N "getcontext"  -I 100
334
335# This is an elided test and is not ported yet.     
336# Check Makefile.darwin for list of elided tests
337# setcontext	$OPTS -N "setcontext"  -I 100
338
339mutex		$OPTS -N "mutex_st"	-I 10
340mutex		$OPTS -N "mutex_mt"	-t -I 10	
341mutex		$OPTS -N "mutex_T2"     -T 2  -I 100
342
343longjmp		$OPTS -N "longjmp"	-I 10
344siglongjmp	$OPTS -N "siglongjmp"	-I 20
345
346getrusage	$OPTS -N "getrusage"	-I 200
347
348times		$OPTS -N "times"	-I 200
349time		$OPTS -N "time"		-I 50
350localtime_r	$OPTS -N "localtime_r"	-I 200  
351strftime	$OPTS -N "strftime" -I 10000 -B 100 
352
353mktime		$OPTS -N "mktime"       -I 500   
354mktime		$OPTS -N "mktimeT2" -T 2 -I 1000 
355
356cascade_mutex	$OPTS -N "c_mutex_1"	-I 50
357cascade_mutex	$OPTS -N "c_mutex_10"	-T 10 -I 5000
358cascade_mutex	$OPTS -N "c_mutex_200"	-T 200	-I 2000000
359
360cascade_cond	$OPTS -N "c_cond_1"	-I 100
361cascade_cond	$OPTS -N "c_cond_10"	-T 10	-I 3000
362cascade_cond	$OPTS -N "c_cond_200"	-T 200	-I 2000000
363
364cascade_lockf	$OPTS -N "c_lockf_1"	-I 1000	
365cascade_lockf	$OPTS -N "c_lockf_10"	-P 10 -I 50000
366#cascade_lockf	$OPTS -N "c_lockf_200"	-P 200 -I 5000000
367
368
369
370cascade_flock	$OPTS -N "c_flock"	-I 1000	
371cascade_flock	$OPTS -N "c_flock_10"	-P 10   -I 50000
372#cascade_flock	$OPTS -N "c_flock_200"	-P 200	-I 5000000
373
374
375
376cascade_fcntl	$OPTS -N "c_fcntl_1"	-I 2000 	
377cascade_fcntl	$OPTS -N "c_fcntl_10"	-P 10 -I 20000
378#cascade_fcntl	$OPTS -N "c_fcntl_200"	-P 200	-I 5000000
379
380
381file_lock	$OPTS -N "file_lock"   -I 1000         
382
383getsockname	$OPTS -N "getsockname"	-I 100
384getpeername	$OPTS -N "getpeername"	-I 100
385
386chdir		$OPTS -N "chdir_tmp"	-I 2000		$TDIR1 $TDIR2
387chdir		$OPTS -N "chdir_usr"	-I 2000		$VDIR1 $VDIR2
388
389chdir		$OPTS -N "chgetwd_tmp"	-I 3000	-g $TDIR1 $TDIR2
390chdir		$OPTS -N "chgetwd_usr"	-I 3000	-g $VDIR1 $VDIR2
391
392realpath	$OPTS -N "realpath_tmp" -I 3000		-f $TDIR1
393realpath	$OPTS -N "realpath_usr"	-I 3000	-f $VDIR1
394
395stat		$OPTS -N "stat_tmp" -I 1000		-f $TFILE
396stat		$OPTS -N "stat_usr" -I 1000		-f $VFILE
397
398lmbench_stat		$OPTS -N "lmbench_stat_tmp" -I 1000		-f $TFILE
399lmbench_stat		$OPTS -N "lmbench_stat_usr" -I 10000 -B 100		-f /private/var/tmp/lmbench
400
401#
402# lmbench uses a touched empty file in /private/var/tmp
403# libMicro uses a 1M file in a directory off /private/var/tmp
404# performance difference is ~ 0.2 usecs/call
405#
406# why? - walking the dir tree, empty file vs. non-empty file, non-empty dir
407# in the case of libMicro, etc., etc.
408#
409
410lmbench_stat		$OPTS -N "lmbench_stat_usr - Default" -I 10000 -B 100	-f /private/var/tmp/lmbench
411
412lmbench_fstat		$OPTS -N "lmbench_fstat_tmp" -I 1000		-f $TFILE
413lmbench_fstat		$OPTS -N "lmbench_fstat_usr" -I 10000 -B 100		-f /private/var/tmp/lmbench
414
415# see stat test to understand why we are using /private/var/tmp/lmbench
416
417lmbench_fstat		$OPTS -N "lmbench_fstat_usr - Default" -I 10000 -B 100	-f /private/var/tmp/lmbench
418
419lmbench_openclose	$OPTS -N "lmbench_openclose - Default" -I 10000 -B 100	-f /private/var/tmp/lmbench
420
421lmbench_select_file $OPTS -N "lmbench_select_file_10"  -n 10  -B 100
422lmbench_select_file $OPTS -N "lmbench_select_file_100" -n 100 -B 100
423lmbench_select_file $OPTS -N "lmbench_select_file_250" -n 250 -B 100
424lmbench_select_file $OPTS -N "lmbench_select_file_500" -n 500 -B 100
425
426lmbench_select_tcp $OPTS -N "lmbench_select_tcp_10"  -n 10  -B 100
427lmbench_select_tcp $OPTS -N "lmbench_select_tcp_100" -n 100 -B 100
428lmbench_select_tcp $OPTS -N "lmbench_select_tcp_250" -n 250 -B 100
429lmbench_select_tcp $OPTS -N "lmbench_select_tcp_500" -n 500 -B 100
430
431fcntl		$OPTS -N "fcntl_tmp"	-I 100	-f $TFILE
432fcntl		$OPTS -N "fcntl_usr"	-I 100	-f $VFILE
433fcntl_ndelay	$OPTS -N "fcntl_ndelay"	-I 100	
434
435lseek		$OPTS -N "lseek_t8k"	-s 8k	-I 50	-f $TFILE
436lseek		$OPTS -N "lseek_u8k"	-s 8k	-I 50	-f $VFILE
437
438open		$OPTS -N "open_tmp"		-B 256		-f $TFILE
439open		$OPTS -N "open_usr"		-B 256		-f $VFILE
440open		$OPTS -N "open_zero"		-B 256		-f /dev/zero
441
442dup		$OPTS -N "dup"			-B 512   
443
444socket		$OPTS -N "socket_u"		-B 256
445socket		$OPTS -N "socket_i"		-B 256		-f PF_INET
446
447socketpair	$OPTS -N "socketpair"		-B 256
448
449setsockopt	$OPTS -N "setsockopt"		-I 200
450
451bind		$OPTS -N "bind"			-B 100
452
453listen		$OPTS -N "listen"		-B 100
454
455#connection	$OPTS -N "connection"		-B 256 
456
457poll		$OPTS -N "poll_10"	-n 10	-I 500
458poll		$OPTS -N "poll_100"	-n 100	-I 1000
459poll		$OPTS -N "poll_1000"	-n 1000	-I 5000
460
461poll		$OPTS -N "poll_w10"	-n 10	-I 500		-w 1
462poll		$OPTS -N "poll_w100"	-n 100	-I 2000		-w 10
463poll		$OPTS -N "poll_w1000"	-n 1000	-I 40000	-w 100
464
465select		$OPTS -N "select_10"	-n 10	-I 500
466select		$OPTS -N "select_100"	-n 100	-I 1000
467select		$OPTS -N "select_1000"	-n 1000	-I 5000
468
469select		$OPTS -N "select_w10"	-n 10	-I 500		-w 1
470select		$OPTS -N "select_w100"	-n 100	-I 2000		-w 10
471select		$OPTS -N "select_w1000"	-n 1000	-I 40000        -w 100
472
473semop		$OPTS -N "semop" -I 200
474
475sigaction	$OPTS -N "sigaction" -I 100
476signal		$OPTS -N "signal" -I 1000
477sigprocmask	$OPTS -N "sigprocmask" -I 200
478
479lmbench_lat_sig_install	$OPTS -N "lmbench_siginstall"
480# sigcatch and sigsend need to be evaluated together
481# lmbench framework will allow multiple measurements within the same
482# benchmark test which allow them to factor out the cost of sending
483# a signal from catching one
484#
485# for our purposes sigcatch results - sigsend results yield
486# lmbench sig handler overhead measurements
487lmbench_lat_sig_catch	$OPTS -N "lmbench_sigcatch" 
488lmbench_lat_sig_send	$OPTS -N "lmbench_sigsend" 
489
490
491pthread_create  $OPTS -N "pthread_8"		-B 8
492pthread_create  $OPTS -N "pthread_32"		-B 32
493pthread_create  $OPTS -N "pthread_128"		-B 128
494pthread_create  $OPTS -N "pthread_512"		-B 512
495
496fork		$OPTS -N "fork_10"		-B 10
497#fork		$OPTS -N "fork_100"		-B 100  -C 100
498
499#fork		$OPTS -N "fork_1000"		-B 1000 -C 50
500
501exit		$OPTS -N "exit_10"		-B 10
502##exit		$OPTS -N "exit_100"		-B 100
503
504#exit		$OPTS -N "exit_1000"		-B 1000 -C 50
505
506exit		$OPTS -N "exit_10_nolibc"	-e -B 10
507
508exec		$OPTS -N "exec" -B 10
509
510posix_spawn	$OPTS -N "posix_spawn" -B 10
511
512system		$OPTS -N "system" -I 1000000
513
514recurse		$OPTS -N "recurse"		-B 512
515
516read		$OPTS -N "read_t1k"	-s 1k -B 50			-f $TFILE
517read		$OPTS -N "read_t10k"	-s 10k	-B 16		-f $TFILE
518read		$OPTS -N "read_t100k"	-s 100k	-B 4		-f $TFILE
519
520read		$OPTS -N "read_u1k"	-s 1k	-B 50		-f $VFILE
521read		$OPTS -N "read_u10k"	-s 10k	-B 16		-f $VFILE
522read		$OPTS -N "read_u100k"	-s 100k	-B 4		-f $VFILE
523
524read		$OPTS -N "read_z1k"	-s 1k	-B 100		-f /dev/zero 
525read		$OPTS -N "read_z10k"	-s 10k	-B 30		-f /dev/zero 
526read		$OPTS -N "read_z100k"	-s 100k	-B 4		-f /dev/zero 
527read		$OPTS -N "read_zw100k"	-s 100k	-B 4         -w	-f /dev/zero 
528
529lmbench_read		$OPTS -N "read_t1b"	-s 1 -B 50			-f $TFILE
530lmbench_read		$OPTS -N "read_t1k"	-s 1k -B 50			-f $TFILE
531lmbench_read		$OPTS -N "read_t10k"	-s 10k	-B 16		-f $TFILE
532lmbench_read		$OPTS -N "read_t100k"	-s 100k	-B 4		-f $TFILE
533
534lmbench_read		$OPTS -N "read_u1b"	-s 1	-B 50		-f $VFILE
535lmbench_read		$OPTS -N "read_u1k"	-s 1k	-B 50		-f $VFILE
536lmbench_read		$OPTS -N "read_u10k"	-s 10k	-B 16		-f $VFILE
537lmbench_read		$OPTS -N "read_u100k"	-s 100k	-B 4		-f $VFILE
538
539lmbench_read		$OPTS -N "read_z1b - Default"	-s 1	-B 100		-f /dev/zero 
540lmbench_read		$OPTS -N "read_z1k"	-s 1k	-B 100		-f /dev/zero 
541lmbench_read		$OPTS -N "read_z10k"	-s 10k	-B 30		-f /dev/zero 
542lmbench_read		$OPTS -N "read_z100k"	-s 100k	-B 4		-f /dev/zero 
543lmbench_read		$OPTS -N "read_zw100k"	-s 100k	-B 4         -w	-f /dev/zero 
544
545write		$OPTS -N "write_t1k"	-s 1k	-B 50		-f $TFILE
546write		$OPTS -N "write_t10k"	-s 10k	-B 25		-f $TFILE
547write		$OPTS -N "write_t100k"	-s 100k	-B 4		-f $TFILE
548
549write		$OPTS -N "write_u1k"	-s 1k	-B 50		-f $VFILE
550write		$OPTS -N "write_u10k"	-s 10k	-B 25		-f $VFILE
551write		$OPTS -N "write_u100k"	-s 100k	-B 4		-f $VFILE
552
553write		$OPTS -N "write_n1k"	-s 1k	-I 100 -B 0	-f /dev/null 
554write		$OPTS -N "write_n10k"	-s 10k	-I 100 -B 0	-f /dev/null 
555write		$OPTS -N "write_n100k"	-s 100k	-I 100 -B 0	-f /dev/null 
556
557lmbench_write		$OPTS -N "lmbench_write_t1b"	-s 1	-B 50		-f $TFILE
558lmbench_write		$OPTS -N "lmbench_write_t1k"	-s 1k	-B 50		-f $TFILE
559lmbench_write		$OPTS -N "lmbench_write_t10k"	-s 10k	-B 25		-f $TFILE
560lmbench_write		$OPTS -N "lmbench_write_t100k"	-s 100k	-B 4		-f $TFILE
561
562lmbench_write		$OPTS -N "lmbench_write_u1b"	-s 1	-B 50		-f $VFILE
563lmbench_write		$OPTS -N "lmbench_write_u1k"	-s 1k	-B 50		-f $VFILE
564lmbench_write		$OPTS -N "lmbench_write_u10k"	-s 10k	-B 25		-f $VFILE
565lmbench_write		$OPTS -N "lmbench_write_u100k"	-s 100k	-B 4		-f $VFILE
566
567lmbench_write		$OPTS -N "lmbench_write_n1b - Default"	-s 1	-I 100 -B 0	-f /dev/null 
568lmbench_write		$OPTS -N "lmbench_write_n1k"	-s 1k	-I 100 -B 0	-f /dev/null 
569lmbench_write		$OPTS -N "lmbench_write_n10k"	-s 10k	-I 100 -B 0	-f /dev/null 
570lmbench_write		$OPTS -N "lmbench_write_n100k"	-s 100k	-I 100 -B 0	-f /dev/null 
571
572writev		$OPTS -N "writev_t1k"	-s 1k	-B 20		-f $TFILE
573writev		$OPTS -N "writev_t10k"	-s 10k	-B 4	        -f $TFILE
574writev		$OPTS -N "writev_t100k"	-s 100k			-f $TFILE
575
576writev		$OPTS -N "writev_u1k"	-s 1k	-B 20		-f $VFILE
577writev		$OPTS -N "writev_u10k"	-s 10k	-B 4		-f $VFILE
578writev		$OPTS -N "writev_u100k"	-s 100k			-f $VFILE
579
580writev		$OPTS -N "writev_n1k"	-s 1k	-I 100 -B 0	-f /dev/null 
581writev		$OPTS -N "writev_n10k"	-s 10k	-I 100 -B 0	-f /dev/null 
582writev		$OPTS -N "writev_n100k"	-s 100k	-I 100 -B 0	-f /dev/null 
583
584pread		$OPTS -N "pread_t1k"	-s 1k	-I 300		-f $TFILE
585pread		$OPTS -N "pread_t10k"	-s 10k	-I 1000		-f $TFILE
586pread		$OPTS -N "pread_t100k"	-s 100k	-I 10000	-f $TFILE
587
588pread		$OPTS -N "pread_u1k"	-s 1k	-I 300		-f $VFILE
589pread		$OPTS -N "pread_u10k"	-s 10k	-I 1000		-f $VFILE
590pread		$OPTS -N "pread_u100k"	-s 100k	-I 10000	-f $VFILE
591
592pread		$OPTS -N "pread_z1k"	-s 1k	-I 300		-f /dev/zero 
593pread		$OPTS -N "pread_z10k"	-s 10k	-I 1000		-f /dev/zero 
594pread		$OPTS -N "pread_z100k"	-s 100k	-I 2000	-f /dev/zero 
595pread		$OPTS -N "pread_zw100k"	-s 100k	-w -I 10000	-f /dev/zero 
596
597pwrite		$OPTS -N "pwrite_t1k"	-s 1k	-I 500		-f $TFILE
598pwrite		$OPTS -N "pwrite_t10k"	-s 10k	-I 1000		-f $TFILE
599pwrite		$OPTS -N "pwrite_t100k"	-s 100k	-I 10000	-f $TFILE
600
601pwrite		$OPTS -N "pwrite_u1k"	-s 1k	-I 500		-f $VFILE
602pwrite		$OPTS -N "pwrite_u10k"	-s 10k	-I 1000		-f $VFILE
603pwrite		$OPTS -N "pwrite_u100k"	-s 100k	-I 20000	-f $VFILE
604
605pwrite		$OPTS -N "pwrite_n1k"	-s 1k	-I 100		-f /dev/null 
606pwrite		$OPTS -N "pwrite_n10k"	-s 10k	-I 100		-f /dev/null 
607pwrite		$OPTS -N "pwrite_n100k"	-s 100k	-I 100		-f /dev/null 
608
609
610mmap		$OPTS -N "mmap_t8k"	-l 8k	-I 1000		-f $TFILE
611mmap		$OPTS -N "mmap_t128k"	-l 128k	-I 1000		-f $TFILE
612mmap		$OPTS -N "mmap_u8k"	-l 8k	-I 1000		-f $VFILE
613mmap		$OPTS -N "mmap_u128k"	-l 128k	-I 1000		-f $VFILE
614mmap		$OPTS -N "mmap_a8k"	-l 8k	-I 200		-f MAP_ANON
615mmap		$OPTS -N "mmap_a128k"	-l 128k	-I 200		-f MAP_ANON
616
617
618
619mmap		$OPTS -N "mmap_rt8k"	-l 8k	-I 2000 -r	-f $TFILE
620mmap		$OPTS -N "mmap_rt128k"	-l 128k	-I 20000 -r	-f $TFILE
621mmap		$OPTS -N "mmap_ru8k"	-l 8k	-I 2000 -r	-f $VFILE
622mmap		$OPTS -N "mmap_ru128k"	-l 128k	-I 20000 -r	-f $VFILE
623mmap		$OPTS -N "mmap_ra8k"	-l 8k	-I 2000 -r	-f MAP_ANON
624mmap		$OPTS -N "mmap_ra128k"	-l 128k	-I 20000 -r	-f MAP_ANON
625
626
627mmap		$OPTS -N "mmap_wt8k"	-l 8k	-I 5000 -w	-f $TFILE
628mmap		$OPTS -N "mmap_wt128k"	-l 128k	-I 50000 -w	-f $TFILE
629mmap		$OPTS -N "mmap_wu8k"	-l 8k	-I 5000 -w	-f $VFILE
630mmap		$OPTS -N "mmap_wu128k"	-l 128k	-I 500000 -w	-f $VFILE
631mmap		$OPTS -N "mmap_wa8k"	-l 8k	-I 3000 -w	-f MAP_ANON
632mmap		$OPTS -N "mmap_wa128k"	-l 128k	-I 50000 -w	-f MAP_ANON
633
634
635munmap		$OPTS -N "unmap_t8k"	-l 8k	-I 500		-f $TFILE
636munmap		$OPTS -N "unmap_t128k"	-l 128k	-I 500		-f $TFILE
637munmap		$OPTS -N "unmap_u8k"	-l 8k	-I 500		-f $VFILE
638munmap		$OPTS -N "unmap_u128k"	-l 128k	-I 500		-f $VFILE
639munmap		$OPTS -N "unmap_a8k"	-l 8k	-I 500		-f MAP_ANON
640munmap		$OPTS -N "unmap_a128k"	-l 128k	-I 500		-f MAP_ANON
641
642
643munmap		$OPTS -N "unmap_rt8k"	-l 8k	-I 1000	-r	-f $TFILE
644munmap		$OPTS -N "unmap_rt128k"	-l 128k	-I 3000	-r	-f $TFILE
645munmap		$OPTS -N "unmap_ru8k"	-l 8k	-I 1000	-r	-f $VFILE
646munmap		$OPTS -N "unmap_ru128k"	-l 128k	-I 3000	-r	-f $VFILE
647munmap		$OPTS -N "unmap_ra8k"	-l 8k	-I 1000	-r	-f MAP_ANON
648munmap		$OPTS -N "unmap_ra128k"	-l 128k	-I 2000	-r	-f MAP_ANON
649
650connection	$OPTS -N "conn_connect"		-B 256 	-c
651
652
653munmap		$OPTS -N "unmap_wt8k"	-l 8k	-I 1000	-w	-f $TFILE
654munmap		$OPTS -N "unmap_wt128k"	-l 128k	-I 10000	-w	-f $TFILE
655munmap		$OPTS -N "unmap_wu8k"	-l 8k	-I 1000	-w	-f $VFILE
656munmap		$OPTS -N "unmap_wu128k"	-l 128k	-I 50000	-w -B 10	-f $VFILE
657munmap		$OPTS -N "unmap_wa8k"	-l 8k	-I 1000	-w	-f MAP_ANON
658munmap		$OPTS -N "unmap_wa128k"	-l 128k	-I 10000	-w	-f MAP_ANON
659
660mprotect	$OPTS -N "mprot_z8k"	-l 8k  -I 300			-f /dev/zero
661mprotect	$OPTS -N "mprot_z128k"	-l 128k	-I 500		-f /dev/zero
662mprotect	$OPTS -N "mprot_wz8k"	-l 8k	-I 500	-w	-f /dev/zero
663mprotect	$OPTS -N "mprot_wz128k"	-l 128k	-I 1000	-w	-f /dev/zero
664mprotect	$OPTS -N "mprot_twz8k"  -l 8k   -I 1000 -w -t   -f /dev/zero
665mprotect	$OPTS -N "mprot_tw128k" -l 128k -I 2000 -w -t   -f /dev/zero
666mprotect	$OPTS -N "mprot_tw4m"   -l 4m   -w -t -B 1  -f /dev/zero
667
668pipe		$OPTS -N "pipe_pst1"	-s 1	-I 1000	-x pipe -m st
669pipe		$OPTS -N "pipe_pmt1"	-s 1	-I 8000	-x pipe -m mt
670pipe		$OPTS -N "pipe_pmp1"	-s 1	-I 8000	-x pipe -m mp
671pipe		$OPTS -N "pipe_pst4k"	-s 4k	-I 1000	-x pipe -m st
672pipe		$OPTS -N "pipe_pmt4k"	-s 4k	-I 8000	-x pipe -m mt
673pipe		$OPTS -N "pipe_pmp4k"	-s 4k	-I 8000	-x pipe -m mp
674
675pipe		$OPTS -N "pipe_sst1"	-s 1	-I 1000	-x sock -m st
676pipe		$OPTS -N "pipe_smt1"	-s 1	-I 8000	-x sock -m mt
677pipe		$OPTS -N "pipe_smp1"	-s 1	-I 8000	-x sock -m mp
678pipe		$OPTS -N "pipe_sst4k"	-s 4k	-I 1000	-x sock -m st
679pipe		$OPTS -N "pipe_smt4k"	-s 4k	-I 8000	-x sock -m mt
680pipe		$OPTS -N "pipe_smp4k"	-s 4k	-I 8000	-x sock -m mp
681
682pipe		$OPTS -N "pipe_tst1"	-s 1	-I 1000	-x tcp  -m st
683pipe		$OPTS -N "pipe_tmt1"	-s 1	-I 8000	-x tcp  -m mt
684pipe		$OPTS -N "pipe_tmp1"	-s 1	-I 8000	-x tcp  -m mp
685pipe		$OPTS -N "pipe_tst4k"	-s 4k	-I 1000	-x tcp  -m st
686pipe		$OPTS -N "pipe_tmt4k"	-s 4k	-I 8000	-x tcp  -m mt
687pipe		$OPTS -N "pipe_tmp4k"	-s 4k	-I 8000	-x tcp  -m mp
688
689#connection	$OPTS -N "conn_accept"		-B 256      -a
690
691lmbench_bw_unix -B 11 -L -W
692
693lmbench_bw_mem $OPTS -N lmbench_bcopy_512 -s 512 -x bcopy
694lmbench_bw_mem $OPTS -N lmbench_bcopy_1k -s 1k -x bcopy
695lmbench_bw_mem $OPTS -N lmbench_bcopy_2k -s 2k -x bcopy
696lmbench_bw_mem $OPTS -N lmbench_bcopy_4k -s 4k -x bcopy
697lmbench_bw_mem $OPTS -N lmbench_bcopy_8k -s 8k -x bcopy
698lmbench_bw_mem $OPTS -N lmbench_bcopy_16k -s 16k -x bcopy
699lmbench_bw_mem $OPTS -N lmbench_bcopy_32k -s 32k -x bcopy
700lmbench_bw_mem $OPTS -N lmbench_bcopy_64k -s 64k -x bcopy
701lmbench_bw_mem $OPTS -N lmbench_bcopy_128k -s 128k -x bcopy
702lmbench_bw_mem $OPTS -N lmbench_bcopy_256k -s 256k -x bcopy
703lmbench_bw_mem $OPTS -N lmbench_bcopy_512k -s 512k -x bcopy
704lmbench_bw_mem $OPTS -N lmbench_bcopy_1m -s 1m -x bcopy
705lmbench_bw_mem $OPTS -N lmbench_bzero_512 -s 512 -x bzero
706lmbench_bw_mem $OPTS -N lmbench_bzero_1k -s 1k -x bzero
707lmbench_bw_mem $OPTS -N lmbench_bzero_2k -s 2k -x bzero
708lmbench_bw_mem $OPTS -N lmbench_bzero_4k -s 4k -x bzero
709lmbench_bw_mem $OPTS -N lmbench_bzero_8k -s 8k -x bzero
710lmbench_bw_mem $OPTS -N lmbench_bzero_16k -s 16k -x bzero
711lmbench_bw_mem $OPTS -N lmbench_bzero_32k -s 32k -x bzero
712lmbench_bw_mem $OPTS -N lmbench_bzero_64k -s 64k -x bzero
713lmbench_bw_mem $OPTS -N lmbench_bzero_128k -s 128k -x bzero
714lmbench_bw_mem $OPTS -N lmbench_bzero_256k -s 256k -x bzero
715lmbench_bw_mem $OPTS -N lmbench_bzero_512k -s 512k -x bzero
716lmbench_bw_mem $OPTS -N lmbench_bzero_1m -s 1m -x bzero
717lmbench_bw_mem $OPTS -N lmbench_bzero_512 -s 512 -x fcp
718lmbench_bw_mem $OPTS -N lmbench_bzero_1k -s 1k -x fcp
719lmbench_bw_mem $OPTS -N lmbench_bzero_2k -s 2k -x fcp
720lmbench_bw_mem $OPTS -N lmbench_bzero_4k -s 4k -x fcp
721lmbench_bw_mem $OPTS -N lmbench_bzero_8k -s 8k -x fcp
722lmbench_bw_mem $OPTS -N lmbench_bzero_16k -s 16k -x fcp
723lmbench_bw_mem $OPTS -N lmbench_bzero_32k -s 32k -x fcp
724lmbench_bw_mem $OPTS -N lmbench_bzero_64k -s 64k -x fcp
725lmbench_bw_mem $OPTS -N lmbench_bzero_128k -s 128k -x fcp
726lmbench_bw_mem $OPTS -N lmbench_bzero_256k -s 256k -x fcp
727lmbench_bw_mem $OPTS -N lmbench_bzero_512k -s 512k -x fcp
728lmbench_bw_mem $OPTS -N lmbench_bzero_1m -s 1m -x fcp
729lmbench_bw_mem $OPTS -N lmbench_cp_512 -s 512 -x cp
730lmbench_bw_mem $OPTS -N lmbench_cp_1k -s 1k -x cp
731lmbench_bw_mem $OPTS -N lmbench_cp_2k -s 2k -x cp
732lmbench_bw_mem $OPTS -N lmbench_cp_4k -s 4k -x cp
733lmbench_bw_mem $OPTS -N lmbench_cp_8k -s 8k -x cp
734lmbench_bw_mem $OPTS -N lmbench_cp_16k -s 16k -x cp
735lmbench_bw_mem $OPTS -N lmbench_cp_32k -s 32k -x cp
736lmbench_bw_mem $OPTS -N lmbench_cp_64k -s 64k -x cp
737lmbench_bw_mem $OPTS -N lmbench_cp_128k -s 128k -x cp
738lmbench_bw_mem $OPTS -N lmbench_cp_256k -s 256k -x cp
739lmbench_bw_mem $OPTS -N lmbench_cp_512k -s 512k -x cp
740lmbench_bw_mem $OPTS -N lmbench_cp_1m -s 1m -x cp
741lmbench_bw_mem $OPTS -N lmbench_frd_512 -s 512 -x frd
742lmbench_bw_mem $OPTS -N lmbench_frd_1k -s 1k -x frd
743lmbench_bw_mem $OPTS -N lmbench_frd_2k -s 2k -x frd
744lmbench_bw_mem $OPTS -N lmbench_frd_4k -s 4k -x frd
745lmbench_bw_mem $OPTS -N lmbench_frd_8k -s 8k -x frd
746lmbench_bw_mem $OPTS -N lmbench_frd_16k -s 16k -x frd
747lmbench_bw_mem $OPTS -N lmbench_frd_32k -s 32k -x frd
748lmbench_bw_mem $OPTS -N lmbench_frd_64k -s 64k -x frd
749lmbench_bw_mem $OPTS -N lmbench_frd_128k -s 128k -x frd
750lmbench_bw_mem $OPTS -N lmbench_frd_256k -s 256k -x frd
751lmbench_bw_mem $OPTS -N lmbench_frd_512k -s 512k -x frd
752lmbench_bw_mem $OPTS -N lmbench_frd_1m -s 1m -x frd
753lmbench_bw_mem $OPTS -N lmbench_rd_512 -s 512 -x rd
754lmbench_bw_mem $OPTS -N lmbench_rd_1k -s 1k -x rd
755lmbench_bw_mem $OPTS -N lmbench_rd_2k -s 2k -x rd
756lmbench_bw_mem $OPTS -N lmbench_rd_4k -s 4k -x rd
757lmbench_bw_mem $OPTS -N lmbench_rd_8k -s 8k -x rd
758lmbench_bw_mem $OPTS -N lmbench_rd_16k -s 16k -x rd
759lmbench_bw_mem $OPTS -N lmbench_rd_32k -s 32k -x rd
760lmbench_bw_mem $OPTS -N lmbench_rd_64k -s 64k -x rd
761lmbench_bw_mem $OPTS -N lmbench_rd_128k -s 128k -x rd
762lmbench_bw_mem $OPTS -N lmbench_rd_256k -s 256k -x rd
763lmbench_bw_mem $OPTS -N lmbench_rd_512k -s 512k -x rd
764lmbench_bw_mem $OPTS -N lmbench_rd_1m -s 1m -x rd
765lmbench_bw_mem $OPTS -N lmbench_fwr_512 -s 512 -x fwr
766lmbench_bw_mem $OPTS -N lmbench_fwr_1k -s 1k -x fwr
767lmbench_bw_mem $OPTS -N lmbench_fwr_2k -s 2k -x fwr
768lmbench_bw_mem $OPTS -N lmbench_fwr_4k -s 4k -x fwr
769lmbench_bw_mem $OPTS -N lmbench_fwr_8k -s 8k -x fwr
770lmbench_bw_mem $OPTS -N lmbench_fwr_16k -s 16k -x fwr
771lmbench_bw_mem $OPTS -N lmbench_fwr_32k -s 32k -x fwr
772lmbench_bw_mem $OPTS -N lmbench_fwr_64k -s 64k -x fwr
773lmbench_bw_mem $OPTS -N lmbench_fwr_128k -s 128k -x fwr
774lmbench_bw_mem $OPTS -N lmbench_fwr_256k -s 256k -x fwr
775lmbench_bw_mem $OPTS -N lmbench_fwr_512k -s 512k -x fwr
776lmbench_bw_mem $OPTS -N lmbench_fwr_1m -s 1m -x fwr
777lmbench_bw_mem $OPTS -N lmbench_wr_512 -s 512 -x wr
778lmbench_bw_mem $OPTS -N lmbench_wr_1k -s 1k -x wr
779lmbench_bw_mem $OPTS -N lmbench_wr_2k -s 2k -x wr
780lmbench_bw_mem $OPTS -N lmbench_wr_4k -s 4k -x wr
781lmbench_bw_mem $OPTS -N lmbench_wr_8k -s 8k -x wr
782lmbench_bw_mem $OPTS -N lmbench_wr_16k -s 16k -x wr
783lmbench_bw_mem $OPTS -N lmbench_wr_32k -s 32k -x wr
784lmbench_bw_mem $OPTS -N lmbench_wr_64k -s 64k -x wr
785lmbench_bw_mem $OPTS -N lmbench_wr_128k -s 128k -x wr
786lmbench_bw_mem $OPTS -N lmbench_wr_256k -s 256k -x wr
787lmbench_bw_mem $OPTS -N lmbench_wr_512k -s 512k -x wr
788lmbench_bw_mem $OPTS -N lmbench_wr_1m -s 1m -x wr
789lmbench_bw_mem $OPTS -N lmbench_rdwr_512 -s 512 -x rdwr
790lmbench_bw_mem $OPTS -N lmbench_rdwr_1k -s 1k -x rdwr
791lmbench_bw_mem $OPTS -N lmbench_rdwr_2k -s 2k -x rdwr
792lmbench_bw_mem $OPTS -N lmbench_rdwr_4k -s 4k -x rdwr
793lmbench_bw_mem $OPTS -N lmbench_rdwr_8k -s 8k -x rdwr
794lmbench_bw_mem $OPTS -N lmbench_rdwr_16k -s 16k -x rdwr
795lmbench_bw_mem $OPTS -N lmbench_rdwr_32k -s 32k -x rdwr
796lmbench_bw_mem $OPTS -N lmbench_rdwr_64k -s 64k -x rdwr
797lmbench_bw_mem $OPTS -N lmbench_rdwr_128k -s 128k -x rdwr
798lmbench_bw_mem $OPTS -N lmbench_rdwr_256k -s 256k -x rdwr
799lmbench_bw_mem $OPTS -N lmbench_rdwr_512k -s 512k -x rdwr
800lmbench_bw_mem $OPTS -N lmbench_rdwr_1m -s 1m -x rdwr
801
802lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_512 -s 512 -f $TFILE
803lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_1k -s 1k -f $TFILE
804lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_2k -s 2k -f $TFILE
805lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_4k -s 4k -f $TFILE
806lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_8k -s 8k -f $TFILE
807lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_16k -s 16k -f $TFILE
808lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_32k -s 32k -f $TFILE
809lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_64k -s 64k -f $TFILE
810lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_128k -s 128k -f $TFILE
811lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_256k -s 256k -f $TFILE
812lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_512k -s 512k -f $TFILE
813lmbench_bw_mmap_rd $OPTS -N bw_mmap_rd_1m -s 1m -f $TFILE
814
815.
816