[why] need to test write, rewrite, read, reread, random write, random read for different block_size.
[How] add judement for variable $block_size to execute iozone command with specificed parameter.
Signed-off-by: Lu Kaiyi 2392863668@qq.com --- tests/iozone | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/tests/iozone b/tests/iozone index 3095ce80..175b206a 100755 --- a/tests/iozone +++ b/tests/iozone @@ -1,13 +1,46 @@ #!/bin/sh - +# - block_size +# - file_size +# - write_rewrite +# - read_reread +# - random_read_write +# - read_backwards +# - rewrite_record +# - stride_read +# - fwrite_refwrite +# - fread_refread +# - random_mix +# - pwrite_repwrite +# - pread_repread +# - pwritev_repwritev +# - preadv_repreadv ## IOzone is a filesystem benchmark tool. The benchmark generates ## and measures a variety of file operations.
. $LKP_SRC/lib/reproduce-log.sh
+cmd="iozone" +[ -n "$block_size" ] && cmd+=" -r $block_size" +[ -n "$file_size" ] && cmd+=" -s $file_size" +[ -n "$write_rewrite" ] && cmd+=" -i 0" +[ -n "$read_reread" ] && cmd+=" -i 1" +[ -n "$random_read_write" ] && cmd+=" -i 2" +[ -n "$read_backwards" ] && cmd+=" -i 3" +[ -n "$rewrite_record" ] && cmd+=" -i 4" +[ -n "$stride_read" ] && cmd+=" -i 5" +[ -n "$fwrite_refwrite" ] && cmd+=" -i 6" +[ -n "$fread_refread" ] && cmd+=" -i 7" +[ -n "$random_mix" ] && cmd+=" -i 8" +[ -n "$pwrite_repwrite" ] && cmd+=" -i 9" +[ -n "$pread_repread" ] && cmd+=" -i 10" +[ -n "$pwritev_repwritev" ] && cmd+=" -i 11" +[ -n "$preadv_repreadv" ] && cmd+=" -i 12" + +[ "${#cmd}" == 6 ] && cmd+=" -a" + for mnt in $mount_points do - cmd="iozone -a -f $mnt/iozonetest" + cmd+=" -f $mnt/iozonetest" log_echo "$cmd &" $cmd > $TMP/iozone-$i & i=$((i+1))