[why] iozone-bs.yaml has combined multiple parameter to single, so, iozone tool also need change the way of parsing parameter. [how] modify the way of parsing parameter.
Signed-off-by: Lu Kaiyi 2392863668@qq.com --- tests/iozone | 66 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/tests/iozone b/tests/iozone index 88a92a18..b6a1e206 100755 --- a/tests/iozone +++ b/tests/iozone @@ -1,42 +1,52 @@ #!/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 +# - test ## IOzone is a filesystem benchmark tool. The benchmark generates ## and measures a variety of file operations.
. $LKP_SRC/lib/reproduce-log.sh
- args="iozone" if [ -n "$block_size" ]; then args+=" -r $block_size" - [ -n "$file_size" ] && args+=" -s $file_size" - [ -n "$write_rewrite" ] && args+=" -i 0" - [ -n "$read_reread" ] && args+=" -i 1" - [ -n "$random_read_write" ] && args+=" -i 2" - [ -n "$read_backwards" ] && args+=" -i 3" - [ -n "$rewrite_record" ] && args+=" -i 4" - [ -n "$stride_read" ] && args+=" -i 5" - [ -n "$fwrite_refwrite" ] && args+=" -i 6" - [ -n "$fread_refread" ] && args+=" -i 7" - [ -n "$random_mix" ] && args+=" -i 8" - [ -n "$pwrite_repwrite" ] && args+=" -i 9" - [ -n "$pread_repread" ] && args+=" -i 10" - [ -n "$pwritev_repwritev" ] && args+=" -i 11" - [ -n "$preadv_repreadv" ] && args+=" -i 12" + [ -n "$file_size" ] && args+=" -s $file_size" + OLD_IFS="$IFS" + # reset IFS to split $test by "," and then restore default + IFS="," + array=($test) + IFS="$OLD_IFS" + for ele in ${array[@]} + do + case $ele in + "write") args+=" -i 0" + ;; + "read") args+=" -i 1" + ;; + "rand_rw") args+=" -i 2" + ;; + "backwards") args+=" -i 3" + ;; + "record") args+=" -i 4" + ;; + "stride") args+=" -i 5" + ;; + "fwrite") args+=" -i 6" + ;; + "fread") args+=" -i 7" + ;; + "rand_mix") args+=" -i 8" + ;; + "pwrite") args+=" -i 9" + ;; + "pread") args+=" -i 10" + ;; + "pwritev") args+=" -i 11" + ;; + "preadv") args+=" -i 12" + ;; + esac + done else args+=" -a" fi
suggest do not use modify
On Thu, Nov 05, 2020 at 02:21:05PM +0800, Lu Kaiyi wrote:
[why] iozone-bs.yaml has combined multiple parameter to single, so, iozone tool also need change the way of parsing parameter. [how] modify the way of parsing parameter.
Signed-off-by: Lu Kaiyi 2392863668@qq.com
tests/iozone | 66 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/tests/iozone b/tests/iozone index 88a92a18..b6a1e206 100755 --- a/tests/iozone +++ b/tests/iozone @@ -1,42 +1,52 @@ #!/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 +# - test ## IOzone is a filesystem benchmark tool. The benchmark generates ## and measures a variety of file operations.
. $LKP_SRC/lib/reproduce-log.sh
args="iozone" if [ -n "$block_size" ]; then args+=" -r $block_size"
- [ -n "$file_size" ] && args+=" -s $file_size"
- [ -n "$write_rewrite" ] && args+=" -i 0"
- [ -n "$read_reread" ] && args+=" -i 1"
- [ -n "$random_read_write" ] && args+=" -i 2"
- [ -n "$read_backwards" ] && args+=" -i 3"
- [ -n "$rewrite_record" ] && args+=" -i 4"
- [ -n "$stride_read" ] && args+=" -i 5"
- [ -n "$fwrite_refwrite" ] && args+=" -i 6"
- [ -n "$fread_refread" ] && args+=" -i 7"
- [ -n "$random_mix" ] && args+=" -i 8"
- [ -n "$pwrite_repwrite" ] && args+=" -i 9"
- [ -n "$pread_repread" ] && args+=" -i 10"
- [ -n "$pwritev_repwritev" ] && args+=" -i 11"
- [ -n "$preadv_repreadv" ] && args+=" -i 12"
- [ -n "$file_size" ] && args+=" -s $file_size"
$file_size is string or digital? it seems that it's a digital, use [ "$file_size" -gt/-eq 0 ] for digital
Thanks, Luan Shengde
- OLD_IFS="$IFS"
- # reset IFS to split $test by "," and then restore default
- IFS=","
- array=($test)
- IFS="$OLD_IFS"
- for ele in ${array[@]}
- do
case $ele in
"write") args+=" -i 0"
;;
"read") args+=" -i 1"
;;
"rand_rw") args+=" -i 2"
;;
"backwards") args+=" -i 3"
;;
"record") args+=" -i 4"
;;
"stride") args+=" -i 5"
;;
"fwrite") args+=" -i 6"
;;
"fread") args+=" -i 7"
;;
"rand_mix") args+=" -i 8"
;;
"pwrite") args+=" -i 9"
;;
"pread") args+=" -i 10"
;;
"pwritev") args+=" -i 11"
;;
"preadv") args+=" -i 12"
;;
esac
- done
else args+=" -a" fi -- 2.23.0
On Thu, Nov 05, 2020 at 02:21:05PM +0800, Lu Kaiyi wrote:
[why] iozone-bs.yaml has combined multiple parameter to single, so, iozone tool also need change the way of parsing parameter. [how] modify the way of parsing parameter.
Signed-off-by: Lu Kaiyi 2392863668@qq.com
tests/iozone | 66 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/tests/iozone b/tests/iozone index 88a92a18..b6a1e206 100755 --- a/tests/iozone +++ b/tests/iozone @@ -1,42 +1,52 @@ #!/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 +# - test ## IOzone is a filesystem benchmark tool. The benchmark generates ## and measures a variety of file operations.
. $LKP_SRC/lib/reproduce-log.sh
args="iozone" if [ -n "$block_size" ]; then args+=" -r $block_size"
- [ -n "$file_size" ] && args+=" -s $file_size"
- [ -n "$write_rewrite" ] && args+=" -i 0"
- [ -n "$read_reread" ] && args+=" -i 1"
- [ -n "$random_read_write" ] && args+=" -i 2"
- [ -n "$read_backwards" ] && args+=" -i 3"
- [ -n "$rewrite_record" ] && args+=" -i 4"
- [ -n "$stride_read" ] && args+=" -i 5"
- [ -n "$fwrite_refwrite" ] && args+=" -i 6"
- [ -n "$fread_refread" ] && args+=" -i 7"
- [ -n "$random_mix" ] && args+=" -i 8"
- [ -n "$pwrite_repwrite" ] && args+=" -i 9"
- [ -n "$pread_repread" ] && args+=" -i 10"
- [ -n "$pwritev_repwritev" ] && args+=" -i 11"
- [ -n "$preadv_repreadv" ] && args+=" -i 12"
- [ -n "$file_size" ] && args+=" -s $file_size"
- OLD_IFS="$IFS"
- # reset IFS to split $test by "," and then restore default
- IFS=","
- array=($test)
- IFS="$OLD_IFS"
What's the IFS or OLD_IFS, you didn't handle them in the last patch.
Thanks, Xueliang
- for ele in ${array[@]}
- do
case $ele in
"write") args+=" -i 0"
;;
"read") args+=" -i 1"
;;
"rand_rw") args+=" -i 2"
;;
"backwards") args+=" -i 3"
;;
"record") args+=" -i 4"
;;
"stride") args+=" -i 5"
;;
"fwrite") args+=" -i 6"
;;
"fread") args+=" -i 7"
;;
"rand_mix") args+=" -i 8"
;;
"pwrite") args+=" -i 9"
;;
"pread") args+=" -i 10"
;;
"pwritev") args+=" -i 11"
;;
"preadv") args+=" -i 12"
;;
esac
- done
else args+=" -a" fi -- 2.23.0
On Thu, Nov 05, 2020 at 03:04:15PM +0800, Cao Xueliang wrote:
On Thu, Nov 05, 2020 at 02:21:05PM +0800, Lu Kaiyi wrote:
[why] iozone-bs.yaml has combined multiple parameter to single, so, iozone tool also need change the way of parsing parameter. [how] modify the way of parsing parameter.
Signed-off-by: Lu Kaiyi 2392863668@qq.com
tests/iozone | 66 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/tests/iozone b/tests/iozone index 88a92a18..b6a1e206 100755 --- a/tests/iozone +++ b/tests/iozone @@ -1,42 +1,52 @@ #!/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 +# - test ## IOzone is a filesystem benchmark tool. The benchmark generates ## and measures a variety of file operations.
. $LKP_SRC/lib/reproduce-log.sh
args="iozone" if [ -n "$block_size" ]; then args+=" -r $block_size"
- [ -n "$file_size" ] && args+=" -s $file_size"
- [ -n "$write_rewrite" ] && args+=" -i 0"
- [ -n "$read_reread" ] && args+=" -i 1"
- [ -n "$random_read_write" ] && args+=" -i 2"
- [ -n "$read_backwards" ] && args+=" -i 3"
- [ -n "$rewrite_record" ] && args+=" -i 4"
- [ -n "$stride_read" ] && args+=" -i 5"
- [ -n "$fwrite_refwrite" ] && args+=" -i 6"
- [ -n "$fread_refread" ] && args+=" -i 7"
- [ -n "$random_mix" ] && args+=" -i 8"
- [ -n "$pwrite_repwrite" ] && args+=" -i 9"
- [ -n "$pread_repread" ] && args+=" -i 10"
- [ -n "$pwritev_repwritev" ] && args+=" -i 11"
- [ -n "$preadv_repreadv" ] && args+=" -i 12"
- [ -n "$file_size" ] && args+=" -s $file_size"
- OLD_IFS="$IFS"
- # reset IFS to split $test by "," and then restore default
- IFS=","
- array=($test)
- IFS="$OLD_IFS"
What's the IFS or OLD_IFS, you didn't handle them in the last patch.
Thanks, Xueliang
IFS(Internal Field Seprator),内部域分隔符。完整定义是The shell uses the value stored in IFS, which is the space, tab, and newline characters by default, to delimit words for the read and set commands, when parsing output from command substitution, and when performing variable substitution.>>IFS="," will affect the expression result of array=($test).
IFS="," will affect the expression result of array=($test). after that, I will restore original IFS by IFS="$OLD_IFS".
Thanks, Kaiyi
- for ele in ${array[@]}
- do
case $ele in
"write") args+=" -i 0"
;;
"read") args+=" -i 1"
;;
"rand_rw") args+=" -i 2"
;;
"backwards") args+=" -i 3"
;;
"record") args+=" -i 4"
;;
"stride") args+=" -i 5"
;;
"fwrite") args+=" -i 6"
;;
"fread") args+=" -i 7"
;;
"rand_mix") args+=" -i 8"
;;
"pwrite") args+=" -i 9"
;;
"pread") args+=" -i 10"
;;
"pwritev") args+=" -i 11"
;;
"preadv") args+=" -i 12"
;;
esac
- done
else args+=" -a" fi -- 2.23.0