From eef39e8d358acc393ac8604b04a26a7cef57d99c Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Thu, 13 Oct 2016 17:41:59 +0200 Subject: [PATCH] ext4test: mount with sync option and print dev stats Mounting with sync to do more IO during test. Print dev stats after umounting. Do not change directory to mounted system, as this is preventing cleanup trap to umount used path in case of failure. Change-Id: I2f444b67b1f293c9d7c939f8f94aa5756e20aa26 Signed-off-by: Pawel Wodkowski --- test/iscsi_tgt/ext4test/ext4test.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/iscsi_tgt/ext4test/ext4test.sh b/test/iscsi_tgt/ext4test/ext4test.sh index abfcb8ed4..9edf3d99a 100755 --- a/test/iscsi_tgt/ext4test/ext4test.sh +++ b/test/iscsi_tgt/ext4test/ext4test.sh @@ -62,25 +62,34 @@ devs=$(iscsiadm -m session -P 3 | grep "Attached scsi disk" | awk '{print $4}') for dev in $devs; do mkfs.ext4 -F /dev/$dev mkdir -p /mnt/${dev}dir - mount /dev/$dev /mnt/${dev}dir + mount -o sync /dev/$dev /mnt/${dev}dir rsync -qav --exclude=".git" $rootdir/ /mnt/${dev}dir/spdk - cd /mnt/${dev}dir/spdk - make DPDK_DIR=$DPDK_DIR clean - make DPDK_DIR=$DPDK_DIR -j16 + make -C /mnt/${dev}dir/spdk DPDK_DIR=$DPDK_DIR clean + make -C /mnt/${dev}dir/spdk DPDK_DIR=$DPDK_DIR -j16 # Print out space consumed on target device to help decide # if/when we need to increase the size of the malloc LUN df -h /dev/$dev rm -rf /mnt/${dev}dir/spdk - cd - done for dev in $devs; do umount /mnt/${dev}dir rm -rf /mnt/${dev}dir + + stats=( $(cat /sys/block/$dev/stat) ) + echo "" + echo "$dev stats" + printf "READ IO cnt: % 8u merges: % 8u sectors: % 8u ticks: % 8u\n" \ + ${stats[0]} ${stats[1]} ${stats[2]} ${stats[3]} + printf "WRITE IO cnt: % 8u merges: % 8u sectors: % 8u ticks: % 8u\n" \ + ${stats[4]} ${stats[5]} ${stats[6]} ${stats[7]} + printf "in flight: % 8u io ticks: % 8u time in queue: % 8u\n" \ + ${stats[8]} ${stats[9]} ${stats[10]} + echo "" done trap - SIGINT SIGTERM EXIT