From 76c7c63e131a5f0068932c78b57eef51bc691810 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 10 Jul 2013 16:44:24 +0200 Subject: [PATCH] genfio: Adding cached_based option By default fio is still run in direct mode which is safer for many benchmarking approach. In some case, you might need to enable the cached-based IOs. The "-c" option is now here for enabling this. --- tools/genfio | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/genfio b/tools/genfio index efc87a29..306d97e5 100755 --- a/tools/genfio +++ b/tools/genfio @@ -29,12 +29,15 @@ RUNTIME=300 ETA=0 MODES="read,write,randread,randwrite" SHORT_HOSTNAME= +CACHED_IO="FALSE" show_help() { PROG=$(basename $0) echo "usage of $PROG:" cat << EOF -h : Show this help & exit +-c : Enable cached-based IOs + by default, fio is run in direct mode -a : Run sequential test then parallel one -s : Run sequential test (default value) one test after another then one disk after another @@ -78,7 +81,6 @@ cat >$TEMPLATE << EOF ioengine=libaio invalidate=1 ramp_time=5 -direct=1 EOF if [ "$RUNTIME" != "0" ]; then @@ -87,6 +89,12 @@ runtime=$RUNTIME EOF fi +if [ "$CACHED_IO" = "FALSE" ]; then +cat >>$TEMPLATE << EOF +direct=1 +EOF +fi + } gen_seq_suite() { @@ -161,7 +169,7 @@ esac } parse_cmdline() { -while getopts "hapsd:b:r:m:" opt; do +while getopts "hacpsd:b:r:m:" opt; do case $opt in h) show_help @@ -170,6 +178,9 @@ while getopts "hapsd:b:r:m:" opt; do b) BLOCK_SIZE=$OPTARG ;; + c) + CACHED_IO="TRUE" + ;; s) if [ "$SEQ" = "-1" ]; then SEQ=1 -- 2.25.1