Whamcloud - gitweb
- clean up last_block cleanup a little
[fs/lustre-release.git] / lustre / scripts / bdev-io-survey.sh
1 #!/bin/bash
2
3 # for now all the units are in 'k', but we could introduce some helpers
4 # would be nice to run tests in the background and trap signals and kill
5 #
6 #  todo:
7 #       make sure devices aren't in use before going to town
8 #       really use threads with iozone
9 #       look into what sgp_dd is really doing, update arguments
10 #       rename config/prepare/setup/cleanup/finish/teardown
11 #       do something with sf and fpp iterating
12 #       discard first vmstat line
13 #
14
15 # a temp dir that is setup and torn down for each script run
16 tmpdir=""
17 # so we can kill background processes as the test cleans up
18 declare -a cleanup_pids
19 # to unmount mounts in our tmpdir before removing it
20 declare -a cleanup_mounts
21 # global for completing the table.  XXX this is a wart that could go
22 cur_y="0"
23 # a global which funcs use to get at the blocks[] array
24 last_block=-1
25
26 # defaults for some options:
27 min_threads=1
28 max_threads=4
29 possible_tests="sgp_dd ext2_iozone echo_filter"
30 run_tests="$possible_tests"
31 echo_module=""
32
33 # optional output directory
34 output_dir=""
35  
36 die() {
37         echo $* 1>&2
38         exit 1
39 }
40 rm_or_die() {
41         for path in $*; do
42                 [ -e $path ] || continue;
43                 [ -f $path ] || die "needed to remove non-file $path"
44                 rm -f $path || die "couldn't remove $path"
45         done
46 }
47 save_output() {
48         [ ! -z "$output_dir" ] && mv -f $1 $output_dir/$2
49 }
50 cleanup() {
51         # only cleanup test runs if we have block devices
52         if [ $last_block != -1 ]; then
53                 for pid in ${cleanup_pids[*]}; do
54                         kill $pid
55                 done
56                 cleanup_echo_filter
57                 for a in ${cleanup_mounts[*]}; do
58                         umount -f $a
59                 done
60         fi
61
62         [ ${#tmpdir} == 18 ] && [ -d $tmpdir ] && rm -rf $tmpdir
63 }
64 trap cleanup EXIT
65
66 pid_now_running() {
67         local pid=$1
68         cleanup_pids[$pid]=$pid
69 }
70 pid_has_stopped() {
71         local pid=$1
72         unset cleanup_pids[$pid]
73 }
74                                                                                 
75 commas() {
76         echo $* | sed -e 's/ /,/g'
77 }
78 do_bc_scale() {
79         local scale=$1
80         shift
81         echo "scale=$scale; $*" | bc
82 }
83 do_bc() {
84         do_bc_scale 10 $*
85 }
86 mean_stddev() {
87         local points=$*
88
89         local avg=0
90         local num=0
91         for p in $points; do
92                 avg=`do_bc $avg + $p`
93                 num=`do_bc $num + 1`
94         done
95         case $num in
96                 0) echo '??' ; return ;;
97                 1) echo "$avg:0" ; return ;;
98         esac
99
100         avg=`do_bc $avg / $num`
101         local tmp=0
102         for p in $points; do
103                 local dev=`do_bc \($p - $avg\) \^ 2`
104                 tmp=`do_bc $tmp + $dev`
105         done
106         tmp=`do_bc_scale 1 sqrt \( $tmp / \($num - 1\) \)`
107         avg=`do_bc_scale 1 $avg / 1`
108         echo "$avg:$tmp"
109 }
110
111 usage() {
112         echo $*
113         echo "       -b <block device to profile>"
114         echo "       -d <summary output directory>"
115         echo "       -l <max io len>"
116         echo "       -t <minimum number of threads per device>"
117         echo "       -T <maximum number of threads per device>"
118         echo "       -r <tests to run>"
119         exit;
120 }
121
122 # some cute code for handling tables whose columns fit
123 set_max() {
124         local target=$1
125         local val=$2
126                                                                                 
127         if [ $val -gt ${!target:-0} ]; then
128                 eval $target=$val
129         fi
130 }
131 table_set() {
132         local name="_table_$1"
133         local col=$2
134         local row=$3
135         local val=$4
136         local num
137                                                                                 
138         eval ${name}_${row}_${col}="'$val'"
139                                                                                 
140         set_max ${name}_${col}_longest ${#val}
141         set_max ${name}_num_col $(($col + 1))
142         set_max ${name}_num_row $(($row + 1))
143 }
144                                                                                 
145 table_get() {
146         local name="_table_$1"
147         local col=$2
148         local row=$3
149         tmp="${name}_${row}_${col}"
150         echo ${!tmp}
151 }
152                                                                                 
153 table_dump() {
154         local name="_table_$1"
155         local num_col;
156         local num_row;
157         local fmt="";
158         local tmp
159         local sep
160                                                                                 
161         tmp="${name}_num_col"
162         num_col="${!tmp:-0}"
163         tmp="${name}_num_row"
164         num_row="${!tmp:-0}"
165                                                                                 
166         # iterate through the columns to find the longest
167                                                                                 
168         sep=" "
169         for x in `seq 0 $num_col`; do
170                 tmp="${name}_${x}_longest"
171                 tmp=${!tmp:-0}
172                 [ $tmp -eq 0 ] && continue
173                                                                                 
174                 [ $x -eq $((num_col - 1)) ] && sep='\n'
175                                                                                 
176                 fmt="$fmt%-${tmp}s$sep"
177         done
178                                                                                 
179         # nothing in the table to print
180         [ -z "$fmt" ] && return
181                                                                                 
182         for y in `seq 0 $num_row`; do
183                 local row=""
184                 for x in `seq 0 $num_col`; do
185                                                                                 
186                         # skip this element if the column is empty
187                         tmp="${name}_${x}_longest"
188                         [ ${!tmp:-0} -eq 0 ] && continue
189                                                                                 
190                         # fill this cell with the value or '' for printf
191                         tmp="${name}_${y}_${x}"
192                         row="$row'${!tmp:-""}' "
193                 done
194                 eval printf "'$fmt'" $row
195         done
196 }
197
198 ######################################################################
199 # the sgp_dd tests
200 sgp_dd_banner() {
201         echo sgp_dd using dio=1 and thr=
202 }
203 sgp_dd_config() {
204         # it could be making sure that the block dev
205         # isn't in use by something else
206         local nothing=0
207 }
208 sgp_dd_prepare() {
209         if ! which sgp_dd; then
210                 echo "can't find sgp_dd binary"
211                 return 1
212         fi
213         return 0
214 }
215 sgp_dd_setup() {
216         # it could be making sure that the block dev
217         # isn't in use by something else
218         local nothing=0
219 }
220 sgp_dd_start() {
221         local threads=$1
222         local iosize=$2
223         local wor=$3
224         local i=$4
225         local ifof;
226         local bdev=${blocks[$i]};
227
228         case "$wor" in
229                 w) ifof="if=/dev/zero of=$bdev" ;;
230                 r) ifof="if=$bdev of=/dev/null" ;;
231                 *) die "asked to do io with $wor?"
232         esac
233         echo sgp_dd $ifof bs=$iosize"k" count=$(($io_len / $iosize)) time=1 \
234                         dio=1 thr=$threads
235 }
236 sgp_dd_result() {
237         local output=$1
238
239         awk '($(NF) == "MB/sec") {print $(NF-1)}' < $output
240 }
241 sgp_dd_cleanup() {
242         # got me
243         local nothing=0
244 }
245 sgp_dd_finish() {
246         # got me
247         local nothing=0
248 }
249 sgp_dd_teardown() {
250         # got me
251         local nothing=0
252 }
253
254 ######################################################################
255 # the iozone tests
256 ext2_iozone_banner() {
257         echo "iozone -I on a clean ext2 fs"
258 }
259 ext2_iozone_config() {
260         local nothing=0
261 }
262 ext2_iozone_prepare() {
263         local index=$1
264         local bdev=${blocks[$index]}
265         local mntpnt=$tmpdir/mount_$index
266
267         if ! which iozone; then
268                 echo "iozone binary not found in PATH"
269                 return 1
270         fi
271         if ! which mke2fs; then
272                 echo "mke2fs binary not found in PATH"
273                 return 1
274         fi
275
276         if ! mkdir -p $mntpnt ; then
277                 echo "$mntpnt isn't a directory?"
278         fi
279
280         echo making ext2 filesystem on $bdev
281         if ! mke2fs -b 4096 $bdev; then
282                 echo "mke2fs failed"
283                 return 1;
284         fi
285
286         if ! mount -t ext2 $bdev $mntpnt; then 
287                 echo "couldn't mount $bdev on $mntpnt"
288                 return 1;
289         fi
290
291         cleanup_mounts[$index]="$mntpnt"
292         return 0
293 }
294 ext2_iozone_setup() {
295         local id=$1
296         local wor=$2
297         local f="$tmpdir/mount_$id/iozone"
298
299         case "$wor" in
300                 w) rm -f $f ;;
301                 r) ;;
302                 *) die "asked to do io with $wor?"
303         esac
304 }
305 ext2_iozone_start() {
306         local threads=$1
307         local iosize=$2
308         local wor=$3
309         local id=$4
310         local args;
311         local f="$tmpdir/mount_$id/iozone"
312
313         case "$wor" in
314                 w) args="-i 0 -w" ;;
315                 r) args="-i 1 -w" ;;
316                 *) die "asked to do io with $wor?"
317         esac
318
319         echo iozone "$args -r ${iosize}k -s $(($io_len / $threads))k \
320                         -t $threads -x -I -f $f"
321 }
322 ext2_iozone_result() {
323         local output=$1
324         local wor=$2
325         local string
326         local field
327
328         case "$wor" in
329                 w) string="writers" 
330                    field=7 
331                         ;;
332                 r) string="readers" 
333                    field=6
334                         ;;
335                 *) die "asked to do io with $wor?"
336         esac
337
338         do_bc_scale 1 `awk '($1 == "Parent" && $'$field' == "'$string'") \
339                         {print $'$(($field + 2))'}' $output` / 1024
340 }
341 ext2_iozone_cleanup() {
342         local id=$1
343         local wor=$2
344         local f="$tmpdir/mount_$id/iozone"
345
346         case "$wor" in
347                 w) ;;
348                 r) rm -f $f ;;
349                 *) die "asked to do io with $wor?"
350         esac
351 }
352 ext2_iozone_finish() {
353         local index=$1
354         local mntpnt=$tmpdir/mount_$index
355
356         umount -f $mntpnt
357         unset cleanup_mounts[$index]
358 }
359 ext2_iozone_teardown() {
360         local nothing=0
361 }
362
363 ######################################################################
364 # the lctl test_brw via the echo_client on top of the filter
365
366 # the echo_client setup is nutty enough to warrant its own clenaup
367 running_config=""
368 running_module=""
369 declare -a running_names
370 declare -a running_oids
371
372 cleanup_echo_filter() {
373         local i
374
375         for i in `seq 0 $last_block`; do
376                 [ -z "${running_oids[$i]}" ] && continue
377                 lctl --device "\$"echo_$i destroy ${running_oids[$i]} \
378                         $running_threads
379         done
380         unset running_oids
381
382         for n in ${running_names[*]}; do
383 # I can't believe leading whitespace matters here.
384 lctl << EOF
385 cfg_device $n
386 cleanup
387 detach
388 quit
389 EOF
390         done
391         unset running_names
392
393         for m in $running_module; do
394                 rmmod $m
395         done
396         running_module=""
397
398         [ ! -z "$running_config" ] && lconf --cleanup $running_config
399         running_config=""
400 }
401
402 echo_filter_banner() {
403         echo "test_brw on the echo_client on the filter" 
404 }
405 echo_filter_config() {
406         local index=$1
407         local bdev=${blocks[$index]}
408         local config="$tmpdir/config.xml"
409
410         if ! which lmc; then
411                 echo "lmc binary not found in PATH"
412                 return 1
413         fi
414         if ! which lconf; then
415                 echo "lconf binary not found in PATH"
416                 return 1
417         fi
418         if ! which lctl; then
419                 echo "lctl binary not found in PATH"
420                 return 1
421         fi
422
423         if [ $index = 0 ]; then
424                 if ! lmc -m $config --add net  \
425                         --node localhost --nid localhost --nettype tcp; then
426                         echo "error adding localhost net node"
427                         return 1
428                 fi
429         fi
430
431         if ! lmc -m $config --add ost --ost ost_$index --node localhost \
432                         --fstype ext3 --dev $bdev --journal_size 400; then
433                 echo "error adding $bdev to config with lmc"
434                 return 1
435         fi
436
437         # it would be nice to be able to ask lmc to setup an echo client
438         # to the filter here.  --add echo_client assumes osc
439 }
440 echo_filter_prepare() {
441         local index=$1
442         local bdev=${blocks[$index]}
443         local config="$tmpdir/config.xml"
444         local name="echo_$index"
445         local uuid="echo_$index_uuid"
446
447         if [ $index = 0 ]; then
448                 if ! lconf --reformat $config; then
449                         echo "error setting up with lconf"
450                         return 1;
451                 fi
452                 running_config="$config"
453                 if ! grep -q '^obdecho\>' /proc/modules; then
454                         local m
455                         if ! modprobe obdecho; then
456                                 if [ ! -z "$echo_module" ]; then
457                                         if ! insmod $echo_module; then
458                                                 echo "err: insmod $echo_module"
459                                                 return 1;
460                                         else
461                                                 m="$echo_module"
462                                         fi
463                                 else
464                                         echo "err: modprobe $obdecho"
465                                         return 1;
466                                 fi
467                         else
468                                 m=obdecho
469                         fi
470                         running_module=`basename $m | cut -d'.' -f 1`
471                 fi
472         fi
473
474 lctl << EOF
475         newdev
476         attach echo_client $name $uuid
477         setup ost_$index
478         quit
479 EOF
480         if [  $? != 0 ]; then
481                 echo "error setting up echo_client $name against ost_$index"
482                 return 1
483         fi
484         running_names[$index]=$name
485 }
486 echo_filter_setup() {
487         local id=$1
488         local wor=$2
489         local threads=$3
490         local name="echo_$id"
491         local oid
492
493         case "$wor" in
494                 w) ;;
495                 r) return ;;
496                 *) die "asked to do io with $wor?"
497         esac
498
499         running_threads=$threads
500         oid=`lctl --device "\$"$name create $threads | \
501                 awk '/ #1 is object id/ { print $6 }'`
502         # XXX need to deal with errors
503         running_oids[$id]=$oid
504 }
505 echo_filter_start() {
506         local threads=$1
507         local iosize=$2
508         local wor=$3
509         local id=$4
510
511         local name="echo_$id"
512         local len_pages=$(($io_len / $(($page_size / 1024)) ))
513         local size_pages=$(($iosize / $(($page_size / 1024)) ))
514
515         case "$wor" in
516                 w) ;;
517                 r) ;;
518                 *) die "asked to do io with $wor?"
519         esac
520
521         echo lctl --threads $threads v "\$"$name \
522                 test_brw 1 $wor v $len_pages t${running_oids[$i]} p$size_pages
523 }
524 echo_filter_result() {
525         local output=$1
526         local total=0
527         local mbs
528
529         for mbs in `awk '($8=="MB/s):"){print substr($7,2)}' < $output`; do
530                 total=$(do_bc $total + $mbs)
531         done
532         do_bc_scale 2 $total / 1
533 }
534 echo_filter_cleanup() {
535         local id=$1
536         local wor=$2
537         local threads=$3
538         local name="echo_$id"
539
540         case "$wor" in
541                 w) return ;;
542                 r) ;;
543                 *) die "asked to do io with $wor?"
544         esac
545
546         lctl --device "\$"$name destroy ${running_oids[$i]} $threads
547         unset running_oids[$i]
548 }
549 echo_filter_finish() {
550         local index=$1
551         # leave real work for _teardown
552 }
553 echo_filter_teardown() {
554         cleanup_echo_filter
555 }
556
557 ######################################################################
558 # the iteration that drives the tests
559
560 test_one() {
561         local test=$1
562         local my_x=$2
563         local threads=$3
564         local iosize=$4
565         local wor=$5
566         local vmstat_pid
567         local vmstat_log="$tmpdir/vmstat.log"
568         local opref="$test-$threads-$iosize-$wor"
569         local -a iostat_pids
570         # sigh.  but this makes it easier to dump into the tables
571         local -a read_req_s
572         local -a mb_s
573         local -a write_req_s
574         local -a sects_req
575         local -a queued_reqs
576         local -a service_ms
577
578         for i in `seq 0 $last_block`; do
579                 ${test}_setup $i $wor $threads
580         done
581
582         echo $test with $threads threads
583
584         # start up vmstat and record its pid
585         nice -19 vmstat 1 > $vmstat_log 2>&1 &
586         [ $? = 0 ] || die "vmstat failed"
587         vmstat_pid=$!
588         pid_now_running $vmstat_pid
589
590         # start up each block device's iostat
591         for i in `seq 0 $last_block`; do
592                 nice -19 iostat -x ${blocks[$i]} 1 | awk \
593                         '($1 == "'${blocks[$i]}'"){print $0; fflush()}' \
594                         > $tmpdir/iostat.$i &
595                 local pid=$!
596                 pid_now_running $pid
597                 iostat_pids[$i]=$pid
598         done
599
600         # start all the tests.  each returns a pid to wait on
601         pids=""
602         for i in `seq 0 $last_block`; do
603                 local cmd=`${test}_start $threads $iosize $wor $i`
604                 $cmd > $tmpdir/$i 2>&1 &
605                 local pid=$!
606                 pids="$pids $pid"
607                 pid_now_running $pid
608         done
609
610         echo -n waiting on pids $pids:
611         for p in $pids; do
612                 wait $p
613                 echo -n .
614                 pid_has_stopped $p
615         done
616
617         # stop vmstat and all the iostats
618         kill $vmstat_pid
619         pid_has_stopped $vmstat_pid
620         for i in `seq 0 $last_block`; do
621                 local pid=${iostat_pids[$i]}
622                 [ -z "$pid" ] && continue
623
624                 kill $pid
625                 unset iostat_pids[$i]
626                 pid_has_stopped $pid
627         done
628
629         # collect the results of vmstat and iostat
630         cpu=$(mean_stddev $(awk \
631               '(NR > 3 && NF == 16 && $16 != "id" )     \
632                 {print 100 - $16}' < $vmstat_log) )
633         save_output $vmstat_log $opref.vmstat
634
635         for i in `seq 0 $last_block`; do
636                 read_req_s[$i]=$(mean_stddev $(awk \
637                       '(NR > 1) {print $4}' < $tmpdir/iostat.$i) )
638                 write_req_s[$i]=$(mean_stddev $(awk \
639                       '(NR > 1) {print $5}' < $tmpdir/iostat.$i) )
640                 sects_req[$i]=$(mean_stddev $(awk \
641                       '(NR > 1) {print $10}' < $tmpdir/iostat.$i) )
642                 queued_reqs[$i]=$(mean_stddev $(awk \
643                       '(NR > 1) {print $11}' < $tmpdir/iostat.$i) )
644                 service_ms[$i]=$(mean_stddev $(awk \
645                       '(NR > 1) {print $13}' < $tmpdir/iostat.$i) )
646
647                 save_output $tmpdir/iostat.$i $opref.iostat.$i
648         done
649
650         # record each index's test results and sum them
651         thru=0
652         for i in `seq 0 $last_block`; do
653                 local t=`${test}_result $tmpdir/$i $wor`
654                 save_output $tmpdir/$i $opref.$i
655                 echo test returned "$t"
656                 mb_s[$i]="$t"
657                 # some tests return mean:stddev per device, filter out stddev
658                 thru=$(do_bc $thru + $(echo $t | sed -e 's/:.*$//g'))
659         done
660
661         for i in `seq 0 $last_block`; do
662                 ${test}_cleanup $i $wor $threads
663         done
664
665         # tabulate the results
666         echo $test did $thru mb/s with $cpu
667         table_set $test $my_x $cur_y `do_bc_scale 2 $thru / 1`
668         table_set $test $(($my_x + 1)) $cur_y $cpu
669
670         for i in `seq 0 $last_block`; do
671                 cur_y=$(($cur_y + 1))
672                 table_set $test $(($my_x)) $cur_y ${mb_s[$i]}
673                 table_set $test $(($my_x + 1)) $cur_y ${read_req_s[$i]}
674                 table_set $test $(($my_x + 2)) $cur_y ${write_req_s[$i]}
675                 table_set $test $(($my_x + 3)) $cur_y ${sects_req[$i]}
676                 table_set $test $(($my_x + 4)) $cur_y ${queued_reqs[$i]}
677                 table_set $test $(($my_x + 5)) $cur_y ${service_ms[$i]}
678         done
679
680         cur_y=$(($cur_y + 1))
681 }
682
683 test_iterator() {
684         local test=$1
685         local thr=$min_threads
686         local cleanup=""
687         local rc=0
688         local i
689         
690         for i in `seq 0 $last_block`; do
691                 if ! ${test}_config $i; then
692                         echo "couldn't config $test for bdev ${blocks[$i]}"
693                         echo "skipping $test for all block devices"
694                         cleanup=$(($i - 1))
695                         rc=1;
696                         break
697                 fi
698         done
699
700         for i in `seq 0 $last_block`; do
701                 # don't prepare if _config already failed
702                 [ ! -z "$cleanup" ] && break
703                 if ! ${test}_prepare $i; then
704                         echo "couldn't prepare $test for bdev ${blocks[$i]}"
705                         echo "skipping $test for all block devices"
706                         cleanup=$(($i - 1))
707                         rc=1;
708                         break
709                 fi
710         done
711
712         while [ -z "$cleanup" -a $thr -lt $(($max_threads + 1)) ]; do
713                 for iosize in 128 512; do
714                         table_set $test 0 $cur_y $thr
715                         table_set $test 1 $cur_y $iosize
716
717                         for wor in w r; do
718                                 table_set $test 2 $cur_y $wor
719                                 test_one $test 3 $thr $iosize $wor
720                         done
721                 done
722                 thr=$(($thr + $thr))
723         done
724
725         [ -z "$cleanup" ] && cleanup=$last_block
726
727         if [ "$cleanup" != -1 ]; then
728                 for i in `seq $cleanup 0`; do
729                         ${test}_finish $i
730                 done
731         fi
732
733         ${test}_teardown
734
735         return $rc;
736 }
737
738 while getopts ":d:b:l:t:T:r:e:" opt; do
739         case $opt in
740                 e) echo_module=$OPTARG                 ;;
741                 b) block=$OPTARG                 ;;
742                 d) output_dir=$OPTARG                 ;;
743                 l) io_len=$OPTARG                       ;;
744                 r) run_tests=$OPTARG                    ;;
745                 t) min_threads=$OPTARG                  ;;
746                 T) max_threads=$OPTARG                  ;;
747                 \?) usage
748         esac
749 done
750
751 page_size=`getconf PAGE_SIZE` || die '"getconf PAGE_SIZE" failed'
752
753 [ ! -z "$echo_module" -a ! -f "$echo_module" ] && \
754         die "obdecho module $echo_module is not a file"
755
756 if [ -z "$io_len" ]; then
757         io_len=`awk '($1 == "MemTotal:"){print $2}' < /proc/meminfo`
758         [ -z "$io_len" ] && die "couldn't determine the amount of memory"
759 fi
760
761 if [ ! -z "$output_dir" ]; then
762         [ ! -e "$output_dir" ] && "output dir $output_dir doesn't exist"
763         [ ! -d "$output_dir" ] && "output dir $output_dir isn't a directory"
764 fi
765
766 block=`echo $block | sed -e 's/,/ /g'`
767 [ -z "$block" ] && usage "need block devices"
768
769 run_tests=`echo $run_tests | sed -e 's/,/ /g'`
770 [ -z "$run_tests" ] && usage "need to specify tests to run with -r"
771 for t in $run_tests; do
772         if ! echo $possible_tests | grep -q $t ; then
773                 die "$t isn't one of the possible tests: $possible_tests"
774         fi
775 done
776
777 [ $min_threads -gt $max_threads ] && \
778         die "min threads $min_threads must be <= min_threads $min_threads"
779
780 for b in $block; do
781         [ ! -e $b ] && die "block device file $b doesn't exist"
782         [ ! -b $b ] && die "$b isn't a block device"
783         dd if=$b of=/dev/null bs=8192 count=1 || \
784                 die "couldn't read 8k from $b, is it alive?"
785         [ ! -b $b ] && die "$b isn't a block device"
786         last_block=$(($last_block + 1))
787         blocks[$last_block]=$b
788 done    
789
790 tmpdir=`mktemp -d /tmp/.surveyXXXXXX` || die "couldn't create tmp dir"
791
792 echo each test will operate on $io_len"k"
793
794 test_results=""
795
796 for t in $run_tests; do
797
798         table_set $t 0 0 "T"
799         table_set $t 1 0 "L"
800         table_set $t 2 0 "m"
801         table_set $t 3 0 "A"
802         table_set $t 4 0 "C"
803         table_set $t 3 1 "MB"
804         table_set $t 4 1 "rR"
805         table_set $t 5 1 "wR"
806         table_set $t 6 1 "SR"
807         table_set $t 7 1 "Q"
808         table_set $t 8 1 "ms"
809         cur_y=2;
810
811         if ! test_iterator $t; then
812                 continue;
813         fi
814         test_results="$test_results $t"
815 done
816
817 [ ! -z "$test_results" ] && (
818         echo
819         echo "T = number of concurrent threads per device"
820         echo "L = base io operation length, in KB"
821         echo "m = IO method: read, write, or over-write"
822         echo "C = percentage CPU used, both user and system"
823         echo "MB/s = per-device throughput"
824         echo "rR = read requests issued to the device per second"
825         echo "wR = write requests issued to the device per second"
826         echo "SR = sectors per request; sectors tend to be 512 bytes"
827         echo "Q = the average number of requests queued on the device"
828         echo "ms = the average ms taken by the device to service a req"
829         echo
830         echo "foo:bar represents a mean of foo with a stddev of bar"
831 )
832
833 for t in $test_results; do
834         ${t}_banner
835         table_dump $t
836 done