4 # check instance matching for derived metrics
6 # Copyright (c) 2009 Ken McDonell. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 if grep -q 'pmRegisterDerived' $PCP_INC_DIR/pmapi.h
21 echo "No derived metric support" >$seq.notrun
22 echo "$seq: [not run] `cat $seq.notrun`"
26 status
=0 # success is the default!
27 $sudo rm -rf $tmp.
* $seq.full
28 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
30 export PCP_DERIVED_CONFIG
=$tmp.config
32 # Derived metric expr dump from 0x8513a48...
33 # expr node 0x867eb68 type=PLUS left=0x867eb98 right=0x867ed28
36 cat $tmp.out
>>$seq.full
37 awk <$tmp.out
>$tmp.
sed '
39 $1 == "expr" && $2 == "node" && $3 ~ /^0x/ { print "s/" $3 "/<addr-" n ">/"; n++ }
41 echo "=== sed ===" >>$seq.full
42 cat $tmp.
sed >>$seq.full
43 sed -f $tmp.
sed <$tmp.out \
45 -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*.*numpmid/TIMESTAMP ... numpmid/' \
46 -e 's/=0x0 /=(nil) /g' \
48 # -e 's/ val=[0-9][0-9]*/ val=<number>/g'
51 # real QA test starts here
53 cat <<End-of-File >$tmp.config
54 my.x1 = sample.bin + sample.part_bin
55 my.x2 = sample.part_bin + sample.bin
56 my.x3 = 2 * sample.part_bin
57 my.x4 = sample.part_bin * 2
58 my.x5 = (sample.bin + sample.part_bin) - (sample.part_bin + sample.bin)
64 pminfo
-Dderive,appl2
-df my
>$tmp.out
2>&1