#!/bin/ksh #################################################################### # This script pulls the DFS cache manager statistics structure # # (cm_stats) from the IRIX icrash command, formats, and prints # # the resulting data. # # # # ./cache.sh stats for the current running # # system # # ./cache.sh namelist corefile for irix corefile dump # # # # ** Must have permission to run the /usr/bin/icrash command. # #################################################################### integer word1 integer word2 integer word3 integer word4 pass=1 print "od -d cm_stats 24" > /tmp/$$.cmdfile /usr/bin/icrash -f /tmp/$$.cmdfile $1 $2 | /usr/bin/sed -e '1,7d' | \ while read line do set -A a $line n=${#a[*]} word1=${a[1]} word2=${a[2]} # IRIX 64 bit platforms dump 2 words per line, 32 bit # dump 4 words per line. if (($n == 3)); then read line word3 word4 else word3=${a[3]} word4=${a[4]} fi case $pass in 1) print "\n Status Cache Counters\n" typeset -R13 print1=$word1 print2=$word2 print3=$word3 print4=$word4 print " CacheEntries $print1 CacheHits $print2" print " CacheMisses $print3 CacheFlushes $print4" pass=2;; 2) print "\n Data Cache Counters\n" typeset -R13 print1=$word1 print2=$word2 print3=$word3 print4=$word4 print " CacheEntries $print1 CacheHits $print2" print " CacheMisses $print3 CacheFlushes $print4" pass=3;; 3) typeset -R12 print1=$word1 print2=$word2 print3=$word3 print4=$word4 print " BytsRdFmCache $print1 BytesRdFmWire $print2" print " BytsWrtToCache$print3 BytsWrtToWire $print4" pass=4;; 4) print "\n Directory Name Lookup Cache Counters\n" typeset -R12 print1=$word1 print2=$word2 print3=$word3 print4=$word4 print " CacheHits $print1 CacheMisses $print2" print "\n Fileset Cache Counters\n" print " Invalidations $print3 Updates $print4" pass=5;; 5) print "\n Status Token Counters\n" typeset -R13 print1=$word1 print2=$word2 print3=$word3 print4=$word4 print " Acquired $print1 Released $print2" print " Revoked $print3" print "\n Data Token Counters\n" print -n " Acquired $print4" pass=6;; 6) typeset -R11 print1=$word1 print2=$word2 print3=$word3 print4=$word4 print " Released $print1" print " Revoked $print2" print "\n Connection (Binding Handle) Counters\n" print " HandlesCreated $print3 HandleWaits $print4" pass=7 ;; esac done rm /tmp/$$.cmdfile exit 0