summaryrefslogtreecommitdiff
path: root/tools/run-readtest.sh
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-01-22 11:27:49 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-01-22 11:27:49 -0500
commit95660a06e295d17e315323aaac9c61dfab3546ed (patch)
tree4986c77bd447edd4bfe1f144bac3604cbf5dae52 /tools/run-readtest.sh
parenta2e77c0c4eee8697ce5cde93e060cf5e78416d7b (diff)
adjust run-readtest.sh so that it can be used as-is for testing multiple blocksizes
Diffstat (limited to 'tools/run-readtest.sh')
-rwxr-xr-xtools/run-readtest.sh43
1 files changed, 22 insertions, 21 deletions
diff --git a/tools/run-readtest.sh b/tools/run-readtest.sh
index b082c2a1a1..5da514bc52 100755
--- a/tools/run-readtest.sh
+++ b/tools/run-readtest.sh
@@ -5,8 +5,8 @@ filesize=100 # megabytes
numfiles=128
nocache=
interleave=
-blocksize=262144
needfiles=1
+write_blocksize=262144
if uname -a | grep --silent arwin ; then
ddmega=m
@@ -20,7 +20,7 @@ while [ $# -gt 1 ] ; do
-f) filesize=$2; shift; shift ;;
-n) numfiles=$2; shift; shift ;;
-N) nocache="-s"; shift; shift ;;
- -b) blocksize=$2; shift; shift ;;
+ *) break ;;
esac
done
@@ -40,6 +40,7 @@ else
fi
if [ x$needfiles != x ] ; then
+ echo "Building files for test..."
if [ x$interleave = x ] ; then
#
@@ -47,13 +48,12 @@ if [ x$needfiles != x ] ; then
#
for i in `seq 1 $numfiles` ; do
- dd of=$dir/testfile_$i if=/dev/zero bs=1$ddmega count=$filesize
- echo $i
+ dd of=$dir/testfile_$i if=/dev/zero bs=1$ddmega count=$filesize >/dev/null 2>&1
done
else
#
- # Create files interleaved, adding $blocksize to each
+ # Create files interleaved, adding $write_blocksize to each
# file in turn.
#
@@ -61,25 +61,26 @@ if [ x$needfiles != x ] ; then
limit=`expr $filesize * 1048576`
while [ $size -lt $limit ] ; do
for i in `seq 1 $numfiles` ; do
- dd if=/dev/zero bs=$blocksize count=1 >> $dir/testfile_$i
+ dd if=/dev/zero bs=$write_blocksize count=1 >> $dir/testfile_$i >/dev/null 2>&1
done
- size=`expr $size + $blocksize`
- echo "Files now @ $size bytes"
+ size=`expr $size + $write_blocksize`
done
fi
fi
-if uname -a | grep --silent arwin ; then
- # clears cache on OS X
- sudo purge
-elif [ -f /proc/sys/vm/drop_cache ] ; then
- # Linux cache clearing
- echo 3 | sudo tee /proc/sys/vm/drop/cache >/dev/null
-else
- # need an alternative for other operating systems
- :
-fi
-
-echo "Ready to run ..."
+for bs in $@ ; do
-./readtest $nocache -b $blocksize -q $dir/testfile_%d
+ if uname -a | grep --silent arwin ; then
+ # clears cache on OS X
+ sudo purge
+ elif [ -f /proc/sys/vm/drop_cache ] ; then
+ # Linux cache clearing
+ echo 3 | sudo tee /proc/sys/vm/drop/cache >/dev/null
+ else
+ # need an alternative for other operating systems
+ :
+ fi
+
+ echo "Blocksize $bs"
+ ./readtest $nocache -b $bs -q $dir/testfile_%d
+done