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.
diff --git a/tools/genfio b/tools/genfio
index efc87a2..306d97e 100755
--- a/tools/genfio
+++ b/tools/genfio
@@ -29,12 +29,15 @@
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 @@
ioengine=libaio
invalidate=1
ramp_time=5
-direct=1
EOF
if [ "$RUNTIME" != "0" ]; then
@@ -87,6 +89,12 @@
EOF
fi
+if [ "$CACHED_IO" = "FALSE" ]; then
+cat >>$TEMPLATE << EOF
+direct=1
+EOF
+fi
+
}
gen_seq_suite() {
@@ -161,7 +169,7 @@
}
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 @@
b)
BLOCK_SIZE=$OPTARG
;;
+ c)
+ CACHED_IO="TRUE"
+ ;;
s)
if [ "$SEQ" = "-1" ]; then
SEQ=1