4 # Verify some irix.resource.efs metrics
6 # See the instructions below for updating expected ranges (search for NOTE)
8 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
12 echo "QA output created by $seq"
14 # get standard filters
20 # Find an efs filesystem ... if you do not have one, abandon ship
24 | $PCP_AWK_PROG ' $2 == "efs" { print $NF; exit }'`
28 # not much you can do if no EFS filesystem found ...
33 [ ! -d $efs/$$
] && $sudo mkdir
$efs/$$
34 $sudo chmod 777 $efs/$$
36 trap "$sudo rm -rf $tmp.* $efs/$$" 0 1 2 3 15
40 # Don't change this lightly---the DELTAS will require tuning
44 # Find metric values and metric names in $tmp.vals.1
46 pminfo
-f irix.resource.efs \
50 /^irix./ { metric = $1 }
51 / value / { print metric, $2 }
53 | LC_COLLATE
=POSIX
sort \
56 # Generate some efs activity
59 $here/src
/mkfiles xxx
$nfiles
61 # Get the new values of the metrics
62 pminfo
-f irix.resource.efs \
66 /^irix./ { metric = $1 }
67 / value / { print metric, $2 }
69 | LC_COLLATE
=POSIX
sort \
72 # clean up mkfiles' handiwork
75 if $sudo rm -rf $efs/$$
79 echo "Error removing files to exercise efs from $efs/$$"
83 # Create and execute a shell script which computes the differences between
84 # the efs metrics and displays the equivalent of
85 # printf("%d\t%s", delta, metric_name)
87 echo '#!/bin/sh' >$tmp.sh
88 LC_COLLATE
=POSIX
join -j 1 -o 2.2 1.2 1.1 -e ERR
$tmp.vals
.1 $tmp.vals
.2 \
89 |
$PCP_AWK_PROG '{ printf "echo %s `expr %d - %d`\n", $3, $1, $2 }' \
91 sh
$tmp.sh
>$tmp.delta
93 # NOTE : how to update the expected value ranges
94 # When new metrics appear use this to determine what resonable differences
101 # Here is where to paste the new values AFTER adjusting them to multiples of
102 # the expected minimum delta (nfiles). Values less than the minimum delta
105 # Things to beware of!
107 # 1. Use only nondeterministic metrics. Some metrics rely on kernel data
108 # structures which may or not be populated with the "right" objects when the
109 # test is run e.g. things like "allocated from free list" vs "allocated new".
111 # 2. Different versions of the kernel may have different paths through the
112 # statistics gathering code. Be conservative in the minima you set below.
113 # The test must work on all of them. If possible, try on a variety of kernels.
114 # E.g. if x.y.z returns 758 on IRIX 6.1 and 516 on IRIX 5.3 the minimum should
117 # 3. Use a quiescent system!
119 # DO NOT INCREASE THESE FIGURES WITHOUT CHECKING THE OUTPUT ON 5.3 and 6.1
121 # Nondeterministic metrics zeroed in list below:
122 # bmapfbc, itobpf, found
124 cat >$tmp.delta.expect
<<END
125 irix.resource.efs.attempts 250
126 irix.resource.efs.attrchg 0
127 irix.resource.efs.bmapfbc 0
128 irix.resource.efs.bmapfbm 0
129 irix.resource.efs.bmaprd 250
130 irix.resource.efs.dirupd 250
131 irix.resource.efs.dup 0
132 irix.resource.efs.found 0
133 irix.resource.efs.frecycle 0
134 irix.resource.efs.ialloccoll 0
135 irix.resource.efs.iallocrd 250
136 irix.resource.efs.iallocrdf 250
137 irix.resource.efs.icreat 250
138 irix.resource.efs.itobp 500
139 irix.resource.efs.itobpf 0
140 irix.resource.efs.iupacc 250
141 irix.resource.efs.iupchg 500
142 irix.resource.efs.iupdat 500
143 irix.resource.efs.iupmod 0
144 irix.resource.efs.iupunk 0
145 irix.resource.efs.iupupd 500
146 irix.resource.efs.missed 0
147 irix.resource.efs.reclaims 0
148 irix.resource.efs.truncs 0
151 LC_COLLATE
=POSIX
sort $tmp.delta.expect |
sed -e 's/[ ][ ]*/ /' >$tmp.filtered
152 mv $tmp.filtered
$tmp.delta.expect
154 # Now generate and run another shell script to compare the observed deltas
155 # with the expected ones
157 echo '#!/bin/sh' >$tmp.delta.sh
158 echo 'sts=0' >>$tmp.delta.sh
159 LC_COLLATE
=POSIX
join -j 1 -o 1.2 2.2 1.1 $tmp.delta
$tmp.delta.expect \
162 printf "[ %d -lt %d ]", $1, $2;
163 printf " && sts=1 && " ;
164 printf "echo \"%s: got %d expected min %d\"\n", $3, $1, $2;
167 echo 'exit $sts' >>$tmp.delta.sh
169 # For debuging use sh -x
176 echo "irix.resource.efs: one or more metrics failed range tests"