summaryrefslogtreecommitdiff
path: root/qa/177
blob: 28e1fa1cb82cca09a84cc815116606098d25597a (plain)
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
#! /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

trap "$sudo rm -f $tmp.*; exit" 0 1 2 3 15

_filter()
{
    $PCP_AWK_PROG '
BEGIN		{ min["0.1"] = 58; max["0.1"] = 62
		  min["0.2"] = 28; max["0.2"] = 32
		  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"] = 120
		  min["0.1-back"] = 1; max["0.1-back"] = 5
		  min["0.1-forw"] = 51; max["0.1-forw"] = 57
		  min["0.1-peek"] = 1; max["0.1-peek"] = 1

		  min["0.2-interp"] = 58; max["0.2-interp"] = 60
		  min["0.2-back"] = 1; max["0.2-back"] = 5
		  min["0.2-forw"] = 51; max["0.2-forw"] = 57
		  min["0.2-peek"] = 1; max["0.2-peek"] = 1

		  min["0.4-interp"] = 29; max["0.4-interp"] = 30
		  min["0.4-back"] = 5; max["0.4-back"] = 20
		  min["0.4-forw"] = 51; max["0.4-forw"] = 57
		  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()
{
    _filter_pmdumplog \
    | grep TIMESTAMP \
    | wc -l \
    | $PCP_AWK_PROG '
BEGIN		{ min = 31; max = 31 }
		{ 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
$sudo rm -f $tmp.* $seq.full
_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
_filter_pmlogger_log <$tmp.log
cat $tmp.log >>$seq.full

echo
echo "=== pmdumplog ===" | tee -a $seq.full
pmdumplog -m $tmp | tee -a $seq.full | _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