From: Erwan Velu Date: Mon, 15 Jul 2013 08:44:58 +0000 (+0200) Subject: genfio: Splitting gen_template in 2 parts X-Git-Tag: fio-2.1.2~42 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=fdc0f3b646e417497849d4398029f780b0e5262f genfio: Splitting gen_template in 2 parts gen_template can be split in to two parts: - the static headers - the dynamic ones linked to the arguments from cmdline The static ones are now in gen_template() call before parsing the cmdline. The dynamic ones are now call in finish_template() after parsing the cmdline. That also open the ability of feeding the fio header during the parsing removing the need of specific variables to remember the values. --- diff --git a/tools/genfio b/tools/genfio index 6d3220da..3f9ab283 100755 --- a/tools/genfio +++ b/tools/genfio @@ -89,13 +89,9 @@ Estimated Time = 6000 seconds : 1 hour 40 minutes EOF } -gen_template() { -cat >$TEMPLATE << EOF -[global] -ioengine=libaio +finish_template() { +cat >>$TEMPLATE <>$TEMPLATE << EOF direct=1 EOF fi +} +gen_template() { +cat >$TEMPLATE << EOF +[global] +ioengine=libaio +invalidate=1 +ramp_time=5 +EOF } gen_seq_suite() { @@ -303,9 +307,10 @@ done ########## MAIN +gen_template parse_cmdline $@ +finish_template check_mode_order -gen_template echo "Generating $OUTFILE" cp -f $TEMPLATE $OUTFILE