Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 180
blobf84132061fea1fcf5d8bf4012c33ae06f7f274de
1 #! /bin/sh
2 # PCP QA Test No. 180
3 # log scanning for bigace
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 environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 arch=archives/bigace_v2
18 trap "rm -f $tmp.*; exit" 0 1 2 3 15
20 _do_cpu()
22 $PCP_AWK_PROG '
23 { cpu += $2 }
24 END { if (cpu < 3) print "CPU: less than 3 sec"
25 else if (cpu < 10) print "CPU: between 3 and 10 sec"
26 else print "CPU: roughly " 10*int((cpu+5)/10) " sec"
30 # real QA test starts here
31 cat <<'End-of-File' >$tmp.pmns
32 root {
33 foo 40:2:1
35 End-of-File
37 DEBUG=-D386
38 DEBUG=-D128
39 DEBUG=
41 DELTA=20
42 time=`which time 2>/dev/null`
44 echo "=== all of the instances ==="
45 if test -n "$time"
46 then
47 ( $time pmval -z -n $tmp.pmns -a $arch -t $DELTA foo ) >$tmp.out 2>$tmp.err
48 else
49 echo "Warning: no time(1) executable found ...."
50 pmval -z -n $tmp.pmns -a $arch -t $DELTA foo >$tmp.out 2>$tmp.err
52 cat $tmp.out
53 echo
54 echo "samples: `grep '^[0-9][0-9]:' $tmp.out | wc -l | sed -e 's/ *//g'`"
55 egrep '^(user|sys)' $tmp.err | _do_cpu
56 pmval -z -D128 -n $tmp.pmns -a $arch -t $DELTA foo 2>$tmp.err >/dev/null
57 echo "__pmLogReads: `grep __pmLogRead $tmp.err | wc -l | sed -e 's/ *//g'`"
59 echo
60 echo "=== just instance #4653127 (always there) ==="
61 if test -n "$time"
62 then
63 ( $time pmval -z -i 4653127 -n $tmp.pmns -a $arch -t $DELTA foo ) >$tmp.out 2>$tmp.err
64 else
65 pmval -z -i 4653127 -n $tmp.pmns -a $arch -t $DELTA foo >$tmp.out 2>$tmp.err
67 cat $tmp.out
68 echo
69 echo "samples: `grep '^[0-9][0-9]:' $tmp.out | wc -l | sed -e 's/ *//g'`"
70 egrep '^(user|sys)' $tmp.err | _do_cpu
71 pmval -z -D128 -i 4653127 -n $tmp.pmns -a $arch -t $DELTA foo 2>$tmp.err >/dev/null
72 echo "__pmLogReads: `grep __pmLogRead $tmp.err | wc -l | sed -e 's/ *//g'`"