4 # pmie - lots of expressions, checking pmie -d output and %v binding
5 # - multihost cases, see also QA 514
7 # Copyright (c) 2012 Ken McDonell. All Rights Reserved.
11 echo "QA output created by $seq"
13 # get standard filters
18 status
=1 # failure is the default!
19 $sudo rm -rf $tmp.
* $seq.full
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
25 -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
26 -e 's/DATE [12][0-9][0-9][0-9]/DATE/' \
27 -e '/evaluator exiting/s/pmie([0-9][0-9]*)/pmie(PID)/' \
28 -e '/Performance Co-Pilot Inference Engine/s/Version .*/Version .../'
31 # mapping to 0x0 -> (nil) needed for C compilers that don't do the
32 # (nil) translation automatically for a printf %p
37 -e 's/0x0\([ (]\)/(nil)\1/g' \
40 $1 == "pmie:" { print; next }
41 /failed: / { print; next }
42 $1 == "bundle:" { skip=1 }
43 skip == 1 { if ($1 == "Rule:") skip = 0 }
46 tr ' =' '\012' <$tmp.tmp \
48 |
$PCP_AWK_PROG >$tmp.
sed '
50 { if (seen[$1] == 1) next
51 printf "s/%s/ADDR%03d/\n",$1,n
55 sed -f $tmp.
sed <$tmp.tmp
58 cat <<'End-of-File' >$tmp.pmie
59 hosts = ":vm00 :vm01 :vm02 :vm03";
60 some_host sampledso.drift $hosts > 0 -> print "some_host:" " @%h %v";
61 all_host 10 * sampledso.drift $hosts == sampledso.ulong.ten $hosts * sampledso.drift $hosts -> print "all_host:" " @%h %v";
62 25%_host (hinv.physmem $hosts / (1024*1024)) > 512 -> print "25%_host:" " @%h %v";
63 min_host hinv.physmem $hosts == 239 * 1024 Kbyte -> print "min_host:" " @%h %v";
64 max_host sampledso.colour $hosts #'red' < max_host max_inst (sampledso.colour $hosts) -> print "max_host:" " @%h %v";
65 sum_host hinv.ncpu $hosts == hinv.ncpu :vm00 + hinv.ncpu :vm01 + hinv.ncpu :vm02 + hinv.ncpu :vm03 -> print "sum_host:" " @%h %v";
66 avg_host min_inst sampledso.bin $hosts == 100 -> print "avg_host:" " @%h [%i] %v";
67 count_host (some_inst sampledso.part_bin > 300) > 0 -> print "count_host:" " @%h [%i] %v";
70 # real QA test starts here
71 cat <<End-of-File | pmie -t 2sec -d -Dappl1 -a archives/multi-vm00 -a archives/multi-vm01 -a archives/multi-vm02 -a archives/multi-vm03 >$tmp.out 2>$tmp.err &
80 # strange but true ... sometimes don't need an echo here to deal
81 # with the pmie> (and no newline) prompt ...
95 echo "pmie PID $!" >>$seq.full
97 echo "=== pmie output ===" >>$seq.full
98 cat $tmp.out
>>$seq.full
100 echo "=== pmie errors ===" >>$seq.full
101 cat $tmp.err
>>$seq.full
103 _filter2
<$tmp.err | _filter