X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=tools%2Fgenfio;h=bbf88337ebbedba7657f09b45e42d66bff70a83c;hb=8ff749cca16845a3172e22323489d20d8f99f9dd;hp=123f6e42a6025fbff8f84483b0c5cb3a34524de5;hpb=60238f0e7c8bb689f31e3871a661741f2c5fd583;p=fio.git diff --git a/tools/genfio b/tools/genfio index 123f6e42..bbf88337 100755 --- a/tools/genfio +++ b/tools/genfio @@ -32,6 +32,7 @@ SHORT_HOSTNAME= CACHED_IO="FALSE" PREFIX="" PREFIX_FILENAME="" +IODEPTH=1 show_help() { PROG=$(basename $0) @@ -48,20 +49,24 @@ show_help() { -p : Run parallel test one test after anoter but all disks at the same time Enabled by default +-D iodepth : Run with the specified iodepth + Default is $IODEPTH -d disk1[,disk2,disk3,..] : Run the tests on the selected disks Separated each disk with a comma Disk name shall be "sdxx", /dev/ shall NOT be used here -r seconds : Time in seconds per benchmark 0 means till the end of the device - Default is 300 seconds + Default is $RUNTIME seconds -b blocksize[,blocksize1, ...] : The blocksizes to test under fio format (4k, 1m, ...) Separated each blocksize with a comma - Default is 4k + Default is $BLOCK_SIZE -m mode1,[mode2,mode3, ...] : Define the fio IO profile to use like read, write, randread, randwrite - Default is "write,randwrite,read,randread" + Default is "$MODES" -x prefix : Add a prefix to the fio filename Useful to let a context associated with the file If the prefix features a / (slash), prefix will be considered as a directory +-A cmd_to_run : System command to run after each job (exec_postrun in fio) +-B cmd_to_run : System command to run before each job (exec_prerun in fio) Example: @@ -86,26 +91,26 @@ Estimated Time = 6000 seconds : 1 hour 40 minutes EOF } -gen_template() { -cat >$TEMPLATE << EOF -[global] -ioengine=libaio -invalidate=1 -ramp_time=5 -EOF +finish_template() { +echo "iodepth=$IODEPTH" >> $TEMPLATE if [ "$RUNTIME" != "0" ]; then -cat >>$TEMPLATE << EOF -runtime=$RUNTIME -EOF + echo "runtime=$RUNTIME" >> $TEMPLATE + echo "time_based" >> $TEMPLATE fi if [ "$CACHED_IO" = "FALSE" ]; then -cat >>$TEMPLATE << EOF -direct=1 -EOF + echo "direct=1" >> $TEMPLATE fi +} +gen_template() { +cat >$TEMPLATE << EOF +[global] +ioengine=libaio +invalidate=1 +ramp_time=5 +EOF } gen_seq_suite() { @@ -180,7 +185,7 @@ esac } parse_cmdline() { -while getopts "hacpsd:b:r:m:x:" opt; do +while getopts "hacpsd:b:r:m:x:D:A:B:" opt; do case $opt in h) show_help @@ -224,9 +229,18 @@ while getopts "hacpsd:b:r:m:x:" opt; do d) DISKS=$OPTARG ;; + D) + IODEPTH=$OPTARG + ;; a) SEQ=2 ;; + B) + echo "exec_prerun=$OPTARG" >> $TEMPLATE + ;; + A) + echo "exec_postrun=$OPTARG" >> $TEMPLATE + ;; \?) echo "Invalid option: -$OPTARG" >&2 ;; @@ -295,9 +309,10 @@ done ########## MAIN -parse_cmdline $@ -check_mode_order gen_template +parse_cmdline "$@" +finish_template +check_mode_order echo "Generating $OUTFILE" cp -f $TEMPLATE $OUTFILE