if { [lsearch -exact [ls $HciSiteDir/exec] monitorShmemFile] == -1 } { return }
proc oth_get_stats {THREAD} { global HciSiteDir if { [lsearch -exact [ls $HciSiteDir/exec] monitorShmemFile] == -1 } { return } msiAttach set pStatus "unknown" set obDataQD "0" set pLastRead "0" set msgsIn "0" set pLastWrite "0" set msgsOut "0" set bytesIn "0" set bytesOut "0" set ibLatency "0" set obLatency "0" set totLatency "0" set tocEntry [msiTocEntry $THREAD] keylget tocEntry INDEX threadIndex msiGetStatSample $threadIndex stats keylget stats PSTATUS pStatus keylget stats OBDATAQD obDataQD keylget stats PLASTREAD pLastRead keylget stats MSGSIN msgsIn keylget stats PLASTWRITE pLastWrite keylget stats MSGSOUT msgsOut keylget stats BYTESIN bytesIn keylget stats BYTESOUT bytesOut keylget stats IBLATENCY ibLatency keylget stats OBLATENCY obLatency keylget stats TOTLATENCY totLatency if {$pLastRead == 0} { set pLastRead "never" } else { set pLastRead [clock format $pLastRead -format "%a %b %d %H:%M:%S"] } if {$pLastWrite == 0} { set pLastWrite "never" } else { set pLastWrite [clock format $pLastWrite -format "%a %b %d %H:%M:%S"] } set outStats "$pStatus^$obDataQD^$pLastRead^$msgsIn^$pLastWrite^$msgsOut^$bytesIn^$bytesOut^$ibLatency^$obLatency^$totLatency" return $outStats}
for thread in $THREADS do STATS=$( hcitcl <<- ! echo [oth_get_stats $thread] exit ! ) PROTOSTATUS=$(echo $STATS | awk -F "^" '{print $1}') QUEUEDEPTH=$(echo $STATS | awk -F "^" '{print $2}') LASTREAD=$(echo $STATS | awk -F "^" '{print $3}') MSGSIN=$(echo $STATS | awk -F "^" '{print $4}') LASTWRITE=$(echo $STATS | awk -F "^" '{print $5}') MSGSOUT=$(echo $STATS | awk -F "^" '{print $6}') # etc.done
checkStatus site01checkStatus site02checkStatus site03
########################################################################## This script checks to see if the list of threads in shared memory# matches what is in the NetConfig##---------# History:#---------## 2004.10.17 Russ Ross# - modified to call setroot instead of hcisetenv# - modified to skip sites that do not have a $HCISITEDIR/exec/monitorShmemFile #ROOT="$HCIROOT"SITELIST=$(list_sites.ksh)if [[ $1 != "" ]];then SITELIST=$1fifor site in $SITELIST; do setroot -clear setroot $ROOT $site if [[ -a $HCISITEDIR/exec/monitorShmemFile ]]; then ### echo "$(hcitcl -c "echo [oth_check_shmem]")" echo "$( hcitcl <<- ! echo [oth_check_shmem] exit ! )" echo "Site: " fidone
proc oth_check_shmem {} { global HciSiteDir if { [lsearch -exact [ls $HciSiteDir/exec] monitorShmemFile] == -1 } { return } msiAttach set msiList [msiTocEntry] netcfgLoad set netList [netcfgGetConnList] lassign [intersect3 $msiList $netList] extraThreads goodThreads x return $extraThreads}
Site:
ob_atc_orsSite:
Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: Site: If you've never paid much attention to creating standard procedures to follow that take shared memory issues into consideration you might be surprised to find out just how many shared memory issues show up the first time you run this script.Even though we are aware of some of the pitfalls they still end up surfacing but we have been able to keep them to a minimum as we become more aware and this script has been helpful in making us more aware.