Skip to content

Commit

Permalink
support arbitrary dd options
Browse files Browse the repository at this point in the history
Usage example: DD_TASKS="1 10 10:bs=1M:oflag=direct"
  • Loading branch information
Fengguang Wu committed Apr 16, 2012
1 parent fcefc87 commit 6d1945a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cases-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jbod_12hdd_fallocate_mmap_randwrite_64k() { jbod_12hdd randwrite mmap 1 64k; }

dd_job() {
job=${nr_dd}dd
[[ $bs != 4k ]] && job+=":bs=$bs"
[[ $dd_opt ]] && job+=":$dd_opt"
echo $job
}

Expand Down
2 changes: 1 addition & 1 deletion dd-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ run_dd() {
mnt=$MNT/$(basename $dev)
rm -f $mnt/zero-$i
# ulimit -m $((i<<10))
dd bs=$bs if=/dev/zero of=$mnt/zero-$i &
dd $(echo $dd_opt | tr : ' ') if=/dev/zero of=$mnt/zero-$i &
echo $! >> pid
# sleep 5
done
Expand Down
5 changes: 5 additions & 0 deletions main-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ do
[[ $fs =~ nfs ]] && devices=$NFS_DEVICE
RAID_LEVEL=jbod

[[ $nr_dd =~ : ]] && {
dd_opt=$(echo $nr_dd | cut -f2- -d:)
nr_dd=$(echo $nr_dd | cut -f1 -d:)
}

cd $BASE_DIR

if [[ $scheme =~ ^fio_ && -f $scheme ]]; then
Expand Down

0 comments on commit 6d1945a

Please sign in to comment.