1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
#! /bin/sh
# PCP QA Test No. 177
# interp.c and excessive reading
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard filters
. ./common.product
. ./common.filter
. ./common.check
pid='' # pid of the pmlogger we start a bit later
_cleanup()
{
[ -n "$pid" ] && $sudo kill -KILL $pid
$sudo rm -f $tmp.*
}
trap "_cleanup; exit 0" 0 1 2 3 15
_filter()
{
$PCP_AWK_PROG '
BEGIN { min["0.1"] = 58; max["0.1"] = 68
min["0.2"] = 26; max["0.2"] = 34
min["0.4"] = 13; max["0.4"] = 17
xx = "'$1'"
}
/^[0-2][0-9]:/ { sample++; next }
/No values/ { noval++; next }
END { if (min[xx] <= sample && sample <= max[xx])
printf "%d-%d samples\n",min[xx],max[xx]
else
printf "unexpected %d samples, not %d-%d\n",sample,min[xx],max[xx]
if (noval > 0) printf "Error: %d \"no values\"\n",noval
}'
}
_filter_err()
{
$PCP_AWK_PROG '
/LogRead.*peek/ { print "__pmLogRead-peek"; next }
/LogRead.*forw/ { print "__pmLogRead-forw"; next }
/LogRead.*back/ { print "__pmLogRead-back"; next }
/FetchInterp/ { print "_pmFetchInterp"; next }' \
| LC_COLLATE=POSIX sort \
| uniq -c \
| $PCP_AWK_PROG '
BEGIN {
min["0.1-interp"] = 116; max["0.1-interp"] = 136
min["0.1-back"] = 1; max["0.1-back"] = 5
min["0.1-forw"] = 50; max["0.1-forw"] = 58
min["0.1-peek"] = 1; max["0.1-peek"] = 1
min["0.2-interp"] = 58; max["0.2-interp"] = 68
min["0.2-back"] = 1; max["0.2-back"] = 5
min["0.2-forw"] = 50; max["0.2-forw"] = 58
min["0.2-peek"] = 1; max["0.2-peek"] = 1
min["0.4-interp"] = 29; max["0.4-interp"] = 34
min["0.4-back"] = 1; max["0.4-back"] = 5
min["0.4-forw"] = 50; max["0.4-forw"] = 58
min["0.4-peek"] = 1; max["0.4-peek"] = 1
xx = "'$1'"
}
{ yy = "" }
$2 ~ /Interp/ { yy = xx "-interp" }
$2 ~ /-back/ { yy = xx "-back" }
$2 ~ /-forw/ { yy = xx "-forw" }
$2 ~ /-peek/ { yy = xx "-peek" }
{ if (yy == "")
print
else if (min[yy] <= $1 && $1 <= max[yy])
printf "%s %d-%d calls\n",$2,min[yy],max[yy]
else
printf "%s unexpected %d calls, not %d-%d\n",$2,$1,min[yy],max[yy]
}'
}
_filter_dump()
{
# expect 30 samples + 1 for prologue + 1 for epilogue == 32
#
_filter_pmdumplog \
| grep TIMESTAMP \
| wc -l \
| $PCP_AWK_PROG '
BEGIN { min = 32; max = 32 }
{ if (min <= $1 && $1 <= max)
printf "%d-%d timestamps\n",min,max
else
printf "unexpected %d timestamps, not %d-%d\n",$1,min,max
}'
}
# real QA test starts here
_start_up_pmlogger -s 30 -L -c /dev/null -l $tmp.log $tmp
pmsleep 0.5
echo
echo "=== log sample.bin[bin-100] ===" | tee -a $seq_full
pmlc <<End-of-File
connect $pid
log mandatory on 200 msec sample.bin ["bin-100"]
End-of-File
pmsleep 4.0
echo
echo "=== log sample.bin[bin-200] ===" | tee -a $seq_full
pmlc <<End-of-File
connect $pid
log mandatory on 200 msec sample.bin ["bin-200"]
End-of-File
_wait_pmlogger_end $pid || _exit 1
pid=''
_filter_pmlogger_log <$tmp.log
cat $tmp.log >>$seq_full
echo
echo "=== pmdumplog ===" | tee -a $seq_full
pmdumplog -L $tmp >>$seq_full
pmdumplog -m $tmp \
| tee -a $seq_full \
| sed \
-e '/^[0-9]/{
s/[0-9][0-9]* metrics*//
N
s/\n/ /
}' \
| _filter_dump
offset=`_arch_start $tmp 0.05`
echo "offset=$offset" >>$seq_full
for delta in 0.1 0.2 0.4
do
echo
echo "=== pmval -t $delta ===" | tee -a $seq_full
pmval -O $offset -Dlog,logmeta,interp -i "bin-100,bin-200" -t $delta -a $tmp sample.bin 2>$tmp.err \
| tee -a $seq_full \
| _filter $delta
_filter_err $delta <$tmp.err
cat $tmp.err >>$seq_full
done
exit 0
|