Whamcloud - gitweb
LU-2730 mdt: fix erroneous LASSERT in mdt_reint_opcode
[fs/lustre-release.git] / lustre-iokit / obdfilter-survey / obdfilter-survey
index 4ebb3e6..19cdaf0 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-
+set -e
 ######################################################################
 # customize per survey
 
@@ -48,6 +48,11 @@ rslt=${rslt:-"$rslt_loc/obdfilter_survey_`date +%F@%R`_`uname -n`"}
 # Set this true to check file contents
 verify=${verify:-0}
 
+# test targets
+targets=${targets:-""}
+# test case
+case=${case:-"disk"}
+
 # total size (MBytes) per obd instance
 # large enough to avoid cache effects 
 # and to make test startup/shutdown overhead insignificant
@@ -135,6 +140,7 @@ get_stats () {
     gawk < $rfile \
        '/^Selected device [0-9]+$/ {n = 0; next}\
        /error/ {n = -1; exit}\
+       /^Total/ {next}\
        /^[0-9]+\/[0-9]+ Total: [0-9]+\.[0-9]+\/second$/ {n++; v=strtonum($3); \
                                                          if (n == 1 || v < min) min = v;\
                                                          if (n == 1 || v > max) max = v;\
@@ -169,6 +175,15 @@ testname2type () {
     esac
 }
 
+# for "echo_client + obdfilter" case, "prep + commit" mode should be used
+# for "echo_client + osc" case, "BRW" mode should be used
+testcase2mode() {
+    case $case in
+    disk) echo "p$1";;
+    *)    echo "g";;
+    esac
+}
+
 print_summary () {
     if [ "$1" = "-n" ]; then
         minusn=$1; shift
@@ -183,8 +198,6 @@ print_summary () {
 #####################################################################
 # One can change variable values in this section as per requirements
 
-targets=${targets:-""}
-case=${case:-"disk"}
 if [ -n "$targets" ]; then
     declare -a ost_names
     declare -a client_names
@@ -272,9 +285,14 @@ for trgt in $targets; do
     ndevs=$((ndevs+1))
 done
 if [ $case == "disk" ]; then
-        for ((i = 0; i < $ndevs; i++)); do
-            ost_names[$i]=${client_names[$i]}
-       done
+    if [ $rszhi -gt 1024 ]; then
+        echo "Test disk case support maximum 1024KB IO data" \
+             "(rszhi=$rszhi is too big) please use a smaller value."
+        exit 1
+    fi
+    for ((i = 0; i < $ndevs; i++)); do
+        ost_names[$i]=${client_names[$i]}
+    done
 fi
 if [ $case == "netdisk" ]; then
         if [ "$targets" ]; then
@@ -462,7 +480,8 @@ for ((rsz = $rszlo; rsz <= $rszhi; rsz*=2)); do
                    echo >> ${cmdsf}_${host} \
                        "$lctl > $tmpfi 2>&1 \\
                          --threads $thr -$snap $devno \\
-                        test_brw $count `testname2type $test` q $pages ${thr_per_obj}t${first_obj} &"
+                         test_brw $count `testname2type $test` q $pages \\
+                         ${thr_per_obj}t${first_obj} `testcase2mode $pages` &"
                 done
                 pidcount=0
                 for host in ${unique_hosts[@]}; do