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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
#!/bin/sh
# PCP QA Test No. 822
# pmlogrewrite culling unused indom
# see http://oss.sgi.com/bugzilla/show_bug.cgi?id=978
# unfortunately oss.sgi.com has gone away, but this is the
# closest we have now
# https://github.com/performancecopilot/pcp/issues/1743
#
# non-valgrind variant, see qa/1404 for the valgrind variant
#
# Copyright (c) 2013,2023 Ken McDonell. All Rights Reserved.
#
# check-group-exclude: iostat
if [ $# -eq 0 ]
then
seq=`basename $0`
echo "QA output created by $seq"
else
# use $seq from caller, unless not set
[ -n "$seq" ] || seq=`basename $0`
echo "QA output created by `basename $0` $*"
fi
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
do_valgrind=false
if [ "$1" = "--valgrind" ]
then
_check_valgrind
do_valgrind=true
elif which valgrind >/dev/null 2>&1
then
: note we want to run both variants for this test, as the
: valgrind variant filters away the functional checks and
: only reports memory issues
fi
_cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
}
status=0 # success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e "s@$tmp@TMP@g" \
# end
}
_doit()
{
rm -f $tmp.meta $tmp.0 $tmp.index
if $do_valgrind
then
_run_valgrind pmlogrewrite -Dappl1 -c $tmp.config $1 $tmp
else
pmlogrewrite -Dappl1 -c $tmp.config $1 $tmp
fi \
| _filter
pmlogcheck -w $tmp
pmdumplog -di $1 >$tmp.in
pmdumplog -di $tmp >$tmp.out
diff -u $tmp.in $tmp.out \
| sed \
-e "s@$tmp@TMP@g" \
-e 's/\(TMP.[^ ]*\).*/\1/' \
-e 's/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9]* /TIMESTAMP /g' \
# end
}
# real QA test starts here
echo "=== case 1, indom 29.2 still used after delete ==="
cat <<'End-of-File' >$tmp.config
metric sample.bin { delete }
End-of-File
_doit archives/ok-bigbin
pminfo -fd -a $tmp sample.bin sample.bucket 2>&1
echo
echo "=== case 2, indom 29.2 should be deleted ==="
cat <<'End-of-File' >$tmp.config
metric sample.bin { delete }
metric sample.bucket { delete }
End-of-File
_doit archives/ok-bigbin
pminfo -fd -a $tmp sample.colour 2>&1
echo
echo "=== case 3, indom 29.1 should be deleted ==="
cat <<'End-of-File' >$tmp.config
metric sample.colour { pmid -> 30.1.5 indom -> 30.1 }
End-of-File
_doit archives/ok-bigbin
pminfo -fd -a $tmp sample.colour 2>&1
echo
echo "=== case 4, indom 29.1 should stay ==="
cat <<'End-of-File' >$tmp.config
metric sample.colour { pmid -> 29.0.5 indom -> 29.1 }
End-of-File
_doit archives/ok-bigbin
pminfo -fd -a $tmp sample.colour 2>&1
# 1 metric for indom 60.11 (hinv.map.scsi) and 60.17
# (network.interface.inet_addr)
# 2 metrics for indom 60.7 (nfs.client.reqs, nfs.server.reqs) and 60.8
# (nfs3.client.reqs, nfs3.server.reqs)
# hinv.cpu.* rewrites are to fix problems in archive that pmlogcheck
# complains about otherwise
echo
echo "=== case 5, indom 60.11 should be deleted ==="
cat <<'End-of-File' >$tmp.config
metric hinv.cpu.clock { units -> 0,-1,0,0,USEC,0 }
metric hinv.cpu.cache { units -> 1,0,0,KBYTE,0,0 }
metric hinv.map.scsi { indom -> NULL output first }
End-of-File
_doit archives/pmiostat_mark
pminfo -fd -a $tmp hinv.map.scsi 2>&1
echo
echo "=== case 6, indom 60.7 should stay ==="
cat <<'End-of-File' >$tmp.config
metric hinv.cpu.clock { units -> 0,-1,0,0,USEC,0 }
metric hinv.cpu.cache { units -> 1,0,0,KBYTE,0,0 }
metric nfs.client.reqs { indom -> NULL output first }
End-of-File
_doit archives/pmiostat_mark
pminfo -fd -a $tmp nfs.client.reqs nfs.server.reqs 2>&1
# 1 metric for indom 1.17 (hinv.map.node) and 1.19 (hinv.map.xbow)
# 2 metrics for in dom 1.2 (hinv.map.disk, hinv.disk_sn)
# 4 metrics for indom 1.1 (hinv.cpuclock, hinv.secondarycache,
# hinv.cputype, hinv.map.cpu)
echo
echo "=== case 7, indom 1.19 should be deleted ==="
cat <<'End-of-File' >$tmp.config
metric hinv.map.xbow { indom -> 1.17 }
End-of-File
_doit archives/oview-short
pminfo -fd -a $tmp hinv.map.node hinv.map.xbow 2>&1
# expect instance errors ... some instances from 1.1 are not in 1.17
echo
echo "=== case 8, indom 1.1 should stay ==="
cat <<'End-of-File' >$tmp.config
metric hinv.map.cpu { indom -> 1.17 }
End-of-File
_doit archives/oview-short
pminfo -fd -a $tmp hinv.map.node hinv.map.cpu hinv.cpuclock 2>&1
echo
echo "=== case 9, indom 1.19 should be deleted, indom 1.17 should become 1.42 ==="
cat <<'End-of-File' >$tmp.config
indom 1.17 { indom -> 1.42 }
metric hinv.map.xbow { indom -> 1.42 }
End-of-File
_doit archives/oview-short
pminfo -fd -a $tmp hinv.map.node hinv.map.xbow 2>&1
# expect instance errors ... some instances from 1.1 are not in 1.17
echo
echo "=== case 10, indom 1.1 should stay ==="
cat <<'End-of-File' >$tmp.config
indom 1.19 { indom -> 1.42 }
metric hinv.map.cpu { indom -> 1.42 }
End-of-File
_doit archives/oview-short
pminfo -fd -a $tmp hinv.map.node hinv.map.cpu hinv.cpuclock 2>&1
echo
echo "=== case 11, indom 1.17 should stay ==="
cat <<'End-of-File' >$tmp.config
metric hinv.machine { indom -> 1.17 output iname "node:2.3" }
End-of-File
_doit archives/oview-short
pminfo -fd -a $tmp hinv.map.node hinv.machine 2>&1
echo
echo "=== case 12, indom 1.17 should become 1.42 ==="
cat <<'End-of-File' >$tmp.config
indom 1.17 { indom -> 1.42 }
metric hinv.machine { indom -> 1.42 output iname "node:2.3" }
End-of-File
_doit archives/oview-short
pminfo -fd -a $tmp hinv.map.node hinv.machine 2>&1
# success, all done
exit
|