Whamcloud - gitweb
b=15685 fix obdfilter-survey script to work properly with remote oss-s
authorElena Gryaznova <grev@sun.com>
Wed, 19 May 2010 13:31:13 +0000 (17:31 +0400)
committerJohann Lombardi <johann@sun.com>
Wed, 19 May 2010 20:48:38 +0000 (22:48 +0200)
a=David.Dillow dillowda@ornl.gov
i=grev

Fix obdfilter-survey to work on multiple OSSes at once

lustre-iokit/obdfilter-survey/libecho
lustre-iokit/obdfilter-survey/obdfilter-survey

index de52762..454ea2e 100644 (file)
@@ -56,9 +56,7 @@ dsh () {
     shift 2
     local command="$@"
 
-    local here=$(pwd)
-
-    command="cd $here; export PATH=/sbin:/usr/sbin:\$PATH; $command"
+    command="export PATH=/sbin:/usr/sbin:\$PATH; $command"
 
     case $DSH in
        ssh)
index 7ce397f..ef1871e 100755 (executable)
@@ -268,6 +268,11 @@ for trgt in $targets; do
     client_names[$ndevs]=${str[1]}
     ndevs=$((ndevs+1))
 done
+if [ $case == "disk" ]; then
+        for ((i = 0; i < $ndevs; i++)); do
+            ost_names[$i]=${client_names[$i]}
+       done
+fi
 if [ $case == "netdisk" ]; then
         if [ "$targets" ]; then
             for ((i = 0; i < $ndevs; i++)); do
@@ -355,25 +360,15 @@ fi
 # get vmstat started
 # disable portals debug and get obdecho loaded on all relevant hosts
 unique_hosts=(`unique ${host_names[@]}`)
+load_obdechos
 pidcount=0
 for host in ${unique_hosts[@]}; do
     host_vmstatf=${vmstatf}_${host}
     echo -n > $host_vmstatf
-    remote_shell $host "vmstat 5 >> $host_vmstatf" &
+    remote_shell $host "vmstat 5 >> $host_vmstatf" &> /dev/null &
     pid=$!
     vmstatpids[$pidcount]=$pid
     pidcount=$((pidcount+1))
-    do_unload_obdecho[$host]=0
-    if obdecho_loaded $host; then
-        continue
-    fi
-    load_obdecho $host
-    if obdecho_loaded $host; then
-        do_unload_obdecho[$host]=1
-        continue
-        fi
-    echo "Can't load obdecho on $host" 1>&2
-    exit 1
 done
 # get all the echo_client device numbers and names
 for ((i=0; i < $ndevs; i++)); do
@@ -390,6 +385,8 @@ if (($ndevs <= 0 || ${#host_names[@]} <= 0)); then
     echo "no devices or hosts specified"
     cleanup 0 $clean_srv_OSS $cleanup_oscs
 fi
+# Buffers will be spread out among all hosts, so allow for that
+max_buffer_mem=$(( ${max_buffer_mem} * ${#unique_hosts[@]} ))
 print_summary "$(date) Obdfilter-survey for case=$case from $(hostname)"
 for ((rsz = $rszlo; rsz <= $rszhi; rsz*=2)); do
     for ((nobj = $nobjlo; nobj <= $nobjhi; nobj*=2)); do 
@@ -501,9 +498,10 @@ for ((rsz = $rszlo; rsz <= $rszhi; rsz*=2)); do
                    tmpfi="${tmpf}_$idx"
                    echo "=============> $test $client_name" >> $workf
                    host="${host_names[$idx]}"
-                   remote_shell $host cat $tmpfi >> $workf
-                   get_stats $tmpfi >> $tmpf
-                   rm $tmpfi
+                   remote_shell $host cat $tmpfi > ${tmpfi}_local
+                   cat ${tmpfi}_local >> $workf
+                   get_stats ${tmpfi}_local >> $tmpf
+                   rm -f $tmpfi ${tmpfi}_local
                done
                # compute/display global min/max stats
                echo "=============> $test global" >> $workf