qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 177
blobf8dfe91fe1341f7c9cee5d31974dfc29b82a8c7a
1 #! /bin/sh
2 # PCP QA Test No. 177
3 # interp.c and excessive reading
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 trap "$sudo rm -f $tmp.*; exit" 0 1 2 3 15
18 _filter()
20 $PCP_AWK_PROG '
21 BEGIN { min["0.1"] = 58; max["0.1"] = 62
22 min["0.2"] = 28; max["0.2"] = 32
23 min["0.4"] = 13; max["0.4"] = 17
24 xx = "'$1'"
26 /^[0-2][0-9]:/ { sample++; next }
27 /No values/ { noval++; next }
28 END { if (min[xx] <= sample && sample <= max[xx])
29 printf "%d-%d samples\n",min[xx],max[xx]
30 else
31 printf "unexpected %d samples, not %d-%d\n",sample,min[xx],max[xx]
32 if (noval > 0) printf "Error: %d \"no values\"\n",noval
36 _filter_err()
38 $PCP_AWK_PROG '
39 /LogRead.*peek/ { print "__pmLogRead-peek"; next }
40 /LogRead.*forw/ { print "__pmLogRead-forw"; next }
41 /LogRead.*back/ { print "__pmLogRead-back"; next }
42 /FetchInterp/ { print "_pmFetchInterp"; next }' \
43 | LC_COLLATE=POSIX sort \
44 | uniq -c \
45 | $PCP_AWK_PROG '
46 BEGIN {
47 min["0.1-interp"] = 116; max["0.1-interp"] = 120
48 min["0.1-back"] = 1; max["0.1-back"] = 5
49 min["0.1-forw"] = 51; max["0.1-forw"] = 58
50 min["0.1-peek"] = 1; max["0.1-peek"] = 1
52 min["0.2-interp"] = 58; max["0.2-interp"] = 60
53 min["0.2-back"] = 1; max["0.2-back"] = 5
54 min["0.2-forw"] = 51; max["0.2-forw"] = 58
55 min["0.2-peek"] = 1; max["0.2-peek"] = 1
57 min["0.4-interp"] = 29; max["0.4-interp"] = 30
58 min["0.4-back"] = 1; max["0.4-back"] = 5
59 min["0.4-forw"] = 51; max["0.4-forw"] = 58
60 min["0.4-peek"] = 1; max["0.4-peek"] = 1
61 xx = "'$1'"
63 { yy = "" }
64 $2 ~ /Interp/ { yy = xx "-interp" }
65 $2 ~ /-back/ { yy = xx "-back" }
66 $2 ~ /-forw/ { yy = xx "-forw" }
67 $2 ~ /-peek/ { yy = xx "-peek" }
68 { if (yy == "")
69 print
70 else if (min[yy] <= $1 && $1 <= max[yy])
71 printf "%s %d-%d calls\n",$2,min[yy],max[yy]
72 else
73 printf "%s unexpected %d calls, not %d-%d\n",$2,$1,min[yy],max[yy]
77 _filter_dump()
79 _filter_pmdumplog \
80 | grep TIMESTAMP \
81 | wc -l \
82 | $PCP_AWK_PROG '
83 BEGIN { min = 31; max = 31 }
84 { if (min <= $1 && $1 <= max)
85 printf "%d-%d timestamps\n",min,max
86 else
87 printf "unexpected %d timestamps, not %d-%d\n",$1,min,max
91 # real QA test starts here
92 $sudo rm -f $tmp.* $seq.full
93 _start_up_pmlogger -s 30 -L -c /dev/null -l $tmp.log $tmp
95 pmsleep 0.5
97 echo
98 echo "=== log sample.bin[bin-100] ===" | tee -a $seq.full
99 pmlc <<End-of-File
100 connect $pid
101 log mandatory on 200 msec sample.bin ["bin-100"]
102 End-of-File
103 pmsleep 4.0
105 echo
106 echo "=== log sample.bin[bin-200] ===" | tee -a $seq.full
107 pmlc <<End-of-File
108 connect $pid
109 log mandatory on 200 msec sample.bin ["bin-200"]
110 End-of-File
112 _wait_pmlogger_end $pid
113 _filter_pmlogger_log <$tmp.log
114 cat $tmp.log >>$seq.full
116 echo
117 echo "=== pmdumplog ===" | tee -a $seq.full
118 pmdumplog -m $tmp | tee -a $seq.full | _filter_dump
120 offset=`_arch_start $tmp 0.05`
121 echo "offset=$offset" >>$seq.full
123 for delta in 0.1 0.2 0.4
125 echo
126 echo "=== pmval -t $delta ===" | tee -a $seq.full
127 pmval -O $offset -Dlog,logmeta,interp -i "bin-100,bin-200" -t $delta -a $tmp sample.bin 2>$tmp.err \
128 | tee -a $seq.full \
129 | _filter $delta
130 _filter_err $delta <$tmp.err
131 cat $tmp.err >>$seq.full
132 done
134 exit 0