Allow for use of an external log device in benchmarks.
authorfsgqa <fsgqa>
Wed, 18 Dec 2002 01:10:06 +0000 (01:10 +0000)
committerfsgqa <fsgqa>
Wed, 18 Dec 2002 01:10:06 +0000 (01:10 +0000)
bench
common.rc

diff --git a/bench b/bench
index 94b2fca3cfea3f6aa9d897c66603e329a5c37cb0..4126eb7eb5862a5d744c37132a5becc092c09ac5 100755 (executable)
--- a/bench
+++ b/bench
@@ -87,6 +87,16 @@ _fail()
     exit 1
 }
 
+bench_mkfs_xfs()
+{
+    mkfs_xfs -f $extra_mkfs_options $@
+}
+
+bench_mount_xfs()
+{
+    mount -t xfs $extra_mount_options $@
+}
+
 _run_benchmark()
 {
     pass=1
@@ -96,11 +106,11 @@ _run_benchmark()
     while [ $pass -le $passes -o $passes -lt 0 ]
     do
         _log "        *** clean scratch device [$bench starting, pass $pass]"
-        mkfs_xfs -f $SCRATCH_DEV 2>&1 |  _fix_malloc >>$FULL \
+        bench_mkfs_xfs  $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \
                             || _fail "            !!! mkfs SCRATCH_DEV failed"
 
         _log "        *** mounting scratch device"
-        mount -t xfs $SCRATCH_DEV $SCRATCH_MNT \
+        bench_mount_xfs $SCRATCH_DEV $SCRATCH_MNT \
                             || _fail "            !!! failed to mount"
         
         _log "        *** mkdir"
@@ -164,10 +174,17 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _require_scratch
 rm -f bench.* results.*
 
+if [ ! -z "$SCRATCH_LOGDEV" -a ! -z "$USE_SCRATCH_LOGDEV" ]
+then
+       extra_log_options="-l $SCRATCH_LOGDEV"
+       extra_mkfs_options="-llogdev=$SCRATCH_LOGDEV"
+       extra_mount_options="-ologdev=$SCRATCH_LOGDEV"
+fi
+
 # $OUT is the report which will ultimately be sent, keep it tidy.
 cat >$OUT <<EOF
-bench: MKFS_OPTIONS=$MKFS_OPTIONS
-bench: MOUNT_OPTIONS=$MOUNT_OPTIONS
+bench: MKFS_OPTIONS=$MKFS_OPTIONS $extra_mkfs_options
+bench: MOUNT_OPTIONS=$MOUNT_OPTIONS $extra_mount_options
 
 EOF
 
index 4f54f0b02be45073138aba32b710ce7d933c0401..2f7334528987eee5197338b9bfac5cf1837e0482 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -503,7 +503,8 @@ _check_fs()
         fi
     fi
 
-    xfs_logprint -t $device 2>&1 | tee $tmp.fs_check | grep -q "<CLEAN>"
+    xfs_logprint -t $device $extra_log_options 2>&1 \
+                | tee $tmp.fs_check | grep -q "<CLEAN>"
     if [ $? -ne 0 ]
     then
         echo "_check_fs: filesystem on $device has dirty log (see $seq.full)"
@@ -516,7 +517,6 @@ _check_fs()
         ok=0
     fi
         
-    
     xfs_check $device 2>&1 | _fix_malloc >$tmp.fs_check 
     if [ -s $tmp.fs_check ]
     then
@@ -530,7 +530,7 @@ _check_fs()
         ok=0
     fi
     
-    if ! xfs_repair -n $device >$tmp.fs_check 2>&1
+    if ! xfs_repair -n $device $extra_log_options >$tmp.fs_check 2>&1
     then
         echo "_check_fs: filesystem on $device is inconsistent (r) (see $seq.full)"