1290 (pcp-6.0.2) | : | 1290 (pcp-6.0.3) | ||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
#debug# tmp=`pwd`/tmp | #debug# tmp=`pwd`/tmp | |||
signal=$PCP_BINADM_DIR/pmsignal | signal=$PCP_BINADM_DIR/pmsignal | |||
status=1 # failure is the default! | status=1 # failure is the default! | |||
username=`id -u -n` | username=`id -u -n` | |||
$sudo rm -rf $tmp.* $seq.full | $sudo rm -rf $tmp.* $seq.full | |||
trap "_cleanup; rm -rf $tmp.*; exit \$status" 0 1 2 3 15 | trap "_cleanup; rm -rf $tmp.*; exit \$status" 0 1 2 3 15 | |||
pmproxy_was_running=false | pmproxy_was_running=false | |||
[ -f $PCP_RUN_DIR/pmproxy.pid ] && pmproxy_was_running=true | [ -f $PCP_RUN_DIR/pmproxy.pid ] && pmproxy_was_running=true | |||
echo "pmproxy_was_running=$pmproxy_was_running" >>$here/$seq.full | echo "pmproxy_was_running=$pmproxy_was_running" >>$here/$seq.full | |||
[ -f $PCP_RUN_DIR/pmproxy.pid ] && echo "pmproxy.pid: `cat $PCP_RUN_DIR/pmproxy. pid`" >>$here/$seq.full | ||||
_cleanup() | _cleanup() | |||
{ | { | |||
echo "=== valgrind report ===" >>$here/$seq.full | echo "=== valgrind report ===" >>$here/$seq.full | |||
cat $tmp._valgrind >>$here/$seq.full | cat $tmp._valgrind >>$here/$seq.full | |||
if $pmproxy_was_running | if $pmproxy_was_running | |||
then | then | |||
echo "Restart pmproxy ..." >>$here/$seq.full | echo "Restart pmproxy ..." >>$here/$seq.full | |||
_service pmproxy restart >>$here/$seq.full 2>&1 | _service pmproxy restart >>$here/$seq.full 2>&1 | |||
_wait_for_pmproxy | _wait_for_pmproxy | |||
else | else | |||
echo "Stopping pmproxy ..." >>$here/$seq.full | echo "Stopping pmproxy ..." >>$here/$seq.full | |||
_service pmproxy stop >>$here/$seq.full 2>&1 | _service pmproxy stop >>$here/$seq.full 2>&1 | |||
fi | fi | |||
} | } | |||
# in addition to the ususal filtering tasks .. | ||||
# on slow VMs (like bozo-vm) we may need to dodge warnings | ||||
# from pmie's rule scheduler around pmcd reconnection ... the awk | ||||
# script at the end iof the pipeline does this. | ||||
# | ||||
_filter() | _filter() | |||
{ | { | |||
sed \ | sed \ | |||
-e '/hinv/s/ [0-9][0-9]*$/ N/' \ | -e '/hinv/s/ [0-9][0-9]*$/ N/' \ | |||
-e '/^[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]/{ | -e '/^[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]/{ | |||
# pmdumptext | # pmdumptext | |||
s//DATE/ | s//DATE/ | |||
s/ [0-9][0-9.]*/ N/g | s/ [0-9][0-9.]*/ N/g | |||
}' \ | }' \ | |||
-e '/^\[[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]]/{ | -e '/^\[[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]]/{ | |||
skipping to change at line 71 | skipping to change at line 77 | |||
}' \ | }' \ | |||
-e '/expr_1/s/ *[0-9][0-9.]*/ N/g' \ | -e '/expr_1/s/ *[0-9][0-9.]*/ N/g' \ | |||
-e '/^@ [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] [0-9][[0-9][0-9][0-9]/{ | -e '/^@ [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] [0-9][[0-9][0-9][0-9]/{ | |||
# pmstat header1 | # pmstat header1 | |||
s//@ DATE/ | s//@ DATE/ | |||
}' \ | }' \ | |||
-e '/^ 1 min swpd free buff cache pi po bi bo in cs us sy id/{ | -e '/^ 1 min swpd free buff cache pi po bi bo in cs us sy id/{ | |||
# pmstat header3 | # pmstat header3 | |||
s// 1 min swpd free buff cache si so bi bo in cs us sy i d/ | s// 1 min swpd free buff cache si so bi bo in cs us sy i d/ | |||
}' \ | }' \ | |||
-e '/[0-9?][0-9.Km]* *[0-9?][0-9.Km]* *[0-9?][0-9.Km]* *[0-9?][0-9.Km] * *[0-9?][0-9.Km]*/{ | -e '/[0-9?][0-9.Kmg]* *[0-9?][0-9.Kmg]* *[0-9?][0-9.Kmg]* *[0-9?][0-9. Kmg]* *[0-9?][0-9.Kmg]*/{ | |||
# pmstat data | # pmstat data | |||
s/ *?/ ?/g | s/ *?/ ?/g | |||
s/ *[0-9][0-9.Km]*/ N/g | s/ *[0-9][0-9.Kmg]*/ N/g | |||
}' \ | }' \ | |||
| _filter_me | | _filter_me \ | |||
| $PCP_AWK_PROG ' | ||||
skip == 1 && /^[^ ]/ { skip = 0 } | ||||
/^run: schedule eval/ { skip = 1 } | ||||
/^sleepTight: negative/ { skip = 1 } | ||||
/^Last sleepTight until:/ { skip = 1 } | ||||
/^This sleepTight\() entry:/ { skip = 1 } | ||||
/^Harvest children done:/ { skip = 1 } | ||||
/^Want sleepTight until:/ { skip = 1 } | ||||
/Task dump @/ { skip = 1 } | ||||
skip == 0 { print }' | ||||
} | } | |||
_filter_me() | _filter_me() | |||
{ | { | |||
sed \ | sed \ | |||
-e "s/`hostname`/MY_HOSTNAME/g" \ | -e "s/`hostname`/MY_HOSTNAME/g" \ | |||
-e "s/`hostname | sed -e 's/\..*//'`/MY_HOSTNAME/" \ | -e "s/`hostname | sed -e 's/\..*//'`/MY_HOSTNAME/" \ | |||
-e "s/local:/MY_HOSTNAME/" \ | -e "s/local:/MY_HOSTNAME/" \ | |||
-e "s/localhost\.localdomain/MY_HOSTNAME/" \ | -e "s/localhost\.localdomain/MY_HOSTNAME/" \ | |||
-e "s/localhost/MY_HOSTNAME/" \ | -e "s/localhost/MY_HOSTNAME/" \ | |||
skipping to change at line 113 | skipping to change at line 130 | |||
{ | { | |||
sed \ | sed \ | |||
-e '/^__pmSetSocketIPC: fd=/d' \ | -e '/^__pmSetSocketIPC: fd=/d' \ | |||
-e '/^__pmSetDataIPC:/d' \ | -e '/^__pmSetDataIPC:/d' \ | |||
-e '/^__pmDataIPC: /d' \ | -e '/^__pmDataIPC: /d' \ | |||
-e '/^IPC table fd/d' \ | -e '/^IPC table fd/d' \ | |||
-e '/^pmproxy: disabled time series, requires libuv support (missing)/d' \ | -e '/^pmproxy: disabled time series, requires libuv support (missing)/d' \ | |||
# end | # end | |||
} | } | |||
# see comments below, ahead of where this is used ... | ||||
# | ||||
_filter_pmstat() | ||||
{ | ||||
tee -a $here/$seq.full \ | ||||
| $PCP_AWK_PROG ' | ||||
BEGIN { skip = 0; h1 = h2 = h3 = 0 } | ||||
skip == 1 { | ||||
if ($0 ~ /End of PCP archive/) | ||||
skip = 0 | ||||
else | ||||
next | ||||
} | ||||
NF == 0 { print; next } | ||||
$2 == "DATE" { | ||||
# heading line 1 only once | ||||
if (h1) | ||||
next | ||||
h1 = 1 | ||||
} | ||||
$1 == "loadavg" { | ||||
# heading line 2 only once | ||||
if (h2) | ||||
next | ||||
h2 = 1 | ||||
} | ||||
$3 == "swpd" { | ||||
# heading line 3 only once | ||||
if (h3) | ||||
next | ||||
h3 = 1 | ||||
} | ||||
{ n = q = 0 | ||||
for (i = 1; i <= NF; i++) { | ||||
if ($i == "?") q++ | ||||
if ($i == "N") n++ | ||||
} | ||||
if (q > NF / 2) { | ||||
# more than half no data, skip this one | ||||
next | ||||
} | ||||
if (n == NF) { | ||||
if (skip == 0) { | ||||
# only report first line of N N ... N | ||||
skip = 1 | ||||
} | ||||
} | ||||
}' | ||||
} | ||||
_do() | _do() | |||
{ | { | |||
echo | echo | |||
echo "+++ $* +++" | tee -a $seq.full | _filter_me | echo "+++ $* +++" | tee -a $seq.full | _filter_me | |||
if which $1 >/dev/null 2>&1 | if which $1 >/dev/null 2>&1 | |||
then | then | |||
eval $* 2>&1 | tee -a $seq.full | _filter | eval $* 2>&1 | tee -a $seq.full | _filter | |||
connects=`grep AcceptNewClient $tmp.log | wc -l | sed -e 's/ *//g'` | connects=`grep AcceptNewClient $tmp.log | wc -l | sed -e 's/ *//g'` | |||
disconnects=`grep DeleteClient $tmp.log | wc -l | sed -e 's/ *//g'` | disconnects=`grep DeleteClient $tmp.log | wc -l | sed -e 's/ *//g'` | |||
difference=$(($connects - $disconnects)) | difference=$(($connects - $disconnects)) | |||
skipping to change at line 154 | skipping to change at line 222 | |||
disk.all.blkread | disk.all.blkread | |||
disk.all.blkwrite | disk.all.blkwrite | |||
kernel.all.intr | kernel.all.intr | |||
kernel.all.intr.non_vme | kernel.all.intr.non_vme | |||
kernel.all.pswitch | kernel.all.pswitch | |||
kernel.all.cpu | kernel.all.cpu | |||
} | } | |||
End-of-File | End-of-File | |||
} | } | |||
$PCP_PS_PROG $PCP_PS_APP_FLAGS | grep -E '[P]ID|[p]mproxy' >>$here/$seq.full | $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep -E '[P]PID|[p]mproxy' >>$here/$seq.full | |||
_service pmproxy stop >/dev/null 2>&1 | _service pmproxy stop >/dev/null 2>&1 | |||
$sudo $signal -a pmproxy >/dev/null 2>&1 | $sudo $signal -s KILL -a pmproxy >/dev/null 2>&1 | |||
$PCP_PS_PROG $PCP_PS_APP_FLAGS | grep -E '[P]ID|[p]mproxy' >>$here/$seq.full | $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep -E '[P]PID|[p]mproxy' >>$here/$seq.full | |||
mkdir -p $tmp.rundir | mkdir -p $tmp.rundir | |||
export PCP_RUN_DIR=$tmp.rundir | export PCP_RUN_DIR=$tmp.rundir | |||
proxyargs="-Dcontext -U $username" | proxyargs="-Dcontext -U $username" | |||
__extra='' | __extra='' | |||
# copied from _run_valgrind (which we cannot use here) ... | # copied from _run_valgrind (which we cannot use here) ... | |||
# | # | |||
# extract version number I.J.K ... ignore anything after that, | # extract version number I.J.K ... ignore anything after that, | |||
# e.g. .SVN or .SVN-Debian for Debian-based distros | # e.g. .SVN or .SVN-Debian for Debian-based distros | |||
skipping to change at line 199 | skipping to change at line 267 | |||
fi | fi | |||
valgrind -s \ | valgrind -s \ | |||
--trace-children=yes \ | --trace-children=yes \ | |||
--leak-check=full --read-var-info=yes --gen-suppressions=all \ | --leak-check=full --read-var-info=yes --gen-suppressions=all \ | |||
--show-leak-kinds=all \ | --show-leak-kinds=all \ | |||
--suppressions=$here/valgrind-suppress $__extra \ | --suppressions=$here/valgrind-suppress $__extra \ | |||
--log-file=$tmp._valgrind \ | --log-file=$tmp._valgrind \ | |||
$PCP_BINADM_DIR/pmproxy $proxyargs -l $tmp.log \ | $PCP_BINADM_DIR/pmproxy $proxyargs -l $tmp.log \ | |||
2>$tmp._valgrind.err >$tmp._valgrind.out & | 2>$tmp._valgrind.err >$tmp._valgrind.out & | |||
_wait_for_pmproxy 44322 $tmp.log | _wait_for_pmproxy | |||
_wait_for_pmproxy_logfile $tmp.log | ||||
export PMPROXY_HOST=localhost | ||||
$PCP_BINADM_DIR/pmcd_wait -t 5sec -h localhost@localhost | $PCP_BINADM_DIR/pmcd_wait -t 5sec -h localhost@localhost | |||
$PCP_PS_PROG $PCP_PS_APP_FLAGS | grep -E '[P]ID|[p]mproxy' >>$here/$seq.full | $PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep -E '[P]PID|[p]mproxy' >>$here/$seq.full | |||
cat $tmp.log >> $here/$seq.full | cat $tmp.log >> $here/$seq.full | |||
# real QA test starts here | # real QA test starts here | |||
export PMPROXY_HOST=localhost | ||||
_do pminfo -h $PMPROXY_HOST -d pmcd.agent | _do pminfo -h $PMPROXY_HOST -d pmcd.agent | |||
_do pminfo -h $PMPROXY_HOST -f sample.hordes | _do pminfo -h $PMPROXY_HOST -f sample.hordes | |||
_do pmprobe -v -h localhost hinv.ncpu | _do pmprobe -v -h localhost hinv.ncpu | |||
_do pmval -h `hostname` -t 0.5 -s 3 sample.bin | _do pmval -h `hostname` -t 0.5 -s 3 sample.bin | |||
echo "kernel.all.load;" >$tmp.in | echo "kernel.all.load;" >$tmp.in | |||
_do pmie -h $PMPROXY_HOST -c $tmp.in -v -t 0.5 -T 1.5 | _do pmie -h $PMPROXY_HOST -c $tmp.in -v -t 0.5 -T 1.75 | |||
echo "kernel.all.cpu.user :localhost;" >$tmp.in | echo "kernel.all.cpu.user :localhost;" >$tmp.in | |||
_do pmie -h $PMPROXY_HOST -c $tmp.in -v -t 0.5 -T 1.5 | _do pmie -h $PMPROXY_HOST -c $tmp.in -v -t 0.5 -T 1.75 | |||
_do pmdumptext -h `hostname` -t 0.5 -s 2 sample.string.hullo | _do pmdumptext -h `hostname` -t 0.5 -s 2 sample.string.hullo | |||
_do pmdumptext -t 0.5 -s 2 localhost:sample.string.hullo | _do pmdumptext -t 0.5 -s 2 localhost:sample.string.hullo | |||
_do pmdumptext -t 0.5 -s 2 `hostname`:kernel.all.load | _do pmdumptext -t 0.5 -s 2 `hostname`:kernel.all.load | |||
# Note: there used to be special casing for Darwin/Solaris platforms | # Note: there used to be special casing for Darwin/Solaris platforms | |||
# here. This is wrong, pmstat must still run on these platforms and | # here. This is wrong, pmstat must still run on these platforms and | |||
# produce no values for some columns. | # produce no values for some columns. | |||
_do pmstat -h $PMPROXY_HOST -t 0.5 -s 2 | _do pmstat -h $PMPROXY_HOST -t 0.5 -s 2 | |||
_do_config | _do_config | |||
_do pmlogger -h localhost -c $tmp.config -t 0.5sec -s 3 -l $tmp.logger.log $tmp. | # and compared to the non-valgrind version, we have to run pmlogger | |||
arch | # for more samples to make sure we get at least some good data | |||
_do pmstat -S +0.25sec -t 0.5sec -a $tmp.arch -z | # | |||
_do pmlogger -h localhost -c $tmp.config -t 0.5sec -s 8 -l $tmp.logger.log $tmp. | ||||
arch | ||||
# and compared to the non-valgrind version, we need to cull out | ||||
# the no data available rows and deal with non-determinism in | ||||
# the number of reported data available samples, and only | ||||
# output the pmstat headings once | ||||
# | ||||
_do pmstat -t 0.5sec -a $tmp.arch -z 2>&1 \ | ||||
| _filter_pmstat | ||||
# for debugging this test ... | ||||
# | ||||
pmdumplog -Lm -z $tmp.arch >>$here/$seq.full 2>&1 | ||||
#pmstat -Dfetch,interp -S +0.4sec -t 0.5sec -a $tmp.arch -z >>$here/$seq.full 2> | ||||
&1 | ||||
( echo ""; echo "=== pmproxy.log ===" ) >>$seq.full | ( echo ""; echo "=== pmproxy.log ===" ) >>$seq.full | |||
cat $tmp.log >>$seq.full | cat $tmp.log >>$seq.full | |||
# stop pmproxy and harvest output ... | # stop pmproxy and harvest output ... | |||
# | # | |||
$sudo $signal -a pmproxy >>$here/$seq.full 2>&1 | $sudo $signal -s KILL -a pmproxy >>$here/$seq.full 2>&1 | |||
sleep 2 | sleep 2 | |||
$sudo $signal -a valgrind.bin >>$here/$seq.full 2>&1 | $sudo $signal -s KILL -a valgrind.bin >>$here/$seq.full 2>&1 | |||
wait | ||||
# also copied from _run_valgrind (which we cannot use here) ... | # also copied from _run_valgrind (which we cannot use here) ... | |||
# | # | |||
echo | echo | |||
echo "=== pmproxy std out ===" | echo "=== pmproxy std out ===" | |||
cat $tmp._valgrind.out | cat $tmp._valgrind.out | |||
echo "=== pmproxy std err ===" | echo "=== pmproxy std err ===" | |||
cat $tmp._valgrind.err | cat $tmp._valgrind.err | |||
echo "=== filtered valgrind report ===" | echo "=== filtered valgrind report ===" | |||
cat $tmp._valgrind | _filter_report | cat $tmp._valgrind | _filter_report | |||
End of changes. 16 change blocks. | ||||
17 lines changed or deleted | 101 lines changed or added |