From: Elena Gryaznova Date: Wed, 21 Jul 2010 16:51:08 +0000 (+0400) Subject: b=15685 fix obdfilter-survey script to work properly with remote oss-s X-Git-Tag: 2.0.0.51~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=53741cd8c7d5df33659d5a763a4e68301926f93f b=15685 fix obdfilter-survey script to work properly with remote oss-s a=David.Dillow dillowda@ornl.gov i=grev Fix obdfilter-survey to work on multiple OSSes at once --- diff --git a/lustre-iokit/obdfilter-survey/libecho b/lustre-iokit/obdfilter-survey/libecho index de52762..454ea2e 100644 --- a/lustre-iokit/obdfilter-survey/libecho +++ b/lustre-iokit/obdfilter-survey/libecho @@ -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) diff --git a/lustre-iokit/obdfilter-survey/obdfilter-survey b/lustre-iokit/obdfilter-survey/obdfilter-survey index 7ce397f..ef1871e 100755 --- a/lustre-iokit/obdfilter-survey/obdfilter-survey +++ b/lustre-iokit/obdfilter-survey/obdfilter-survey @@ -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