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
|
#!/bin/sh
# PCP QA Test No. 1179
# Exercise the BCC PMDA ustat module - install, remove and values.
#
# Copyright (c) 2018-2019 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
. ./common.bcc
_pmdabcc_check
_pmdabcc_require_kernel_version 4 7
_java_check
status=1 # failure is the default!
signal=$PCP_BINADM_DIR/pmsignal
# Launch a Java test program
cd $here/java
if [ "$__java_major" -ge 19 ]
then
# -XX:+ExtendedDTraceProbes deprecated here
#
__java_flags="-XX:+DTraceAllocProbes -XX:+DTraceMethodProbes -XX:+DTraceMonitorProbes"
else
__java_flags="-XX:+DTraceAllocProbes -XX:+ExtendedDTraceProbes"
fi
java $__java_flags USDTJVMTest &
javapid=$!
disown > /dev/null 2>&1 || :
cd $here
cat <<EOF >$tmp.conf
# Installed by PCP QA test $seq on `date`
[pmda]
modules = ustat
prefix = bcc.
[ustat]
module = ustat
cluster = 17
process = java
language = java
EOF
_pmdabcc_try_compile $tmp.conf
_prepare_pmda bcc
trap "\$signal -s KILL \$javapid > /dev/null 2>&1; _pmdabcc_cleanup; exit \$status" 0 1 2 3 15
_stop_auto_restart pmcd
# real QA test starts here
_pmdabcc_install <$tmp.conf | _pmdabcc_install_filter
_pmdabcc_wait_for_metric
# Wait for values to appear
pmsleep 1
echo "=== report metric values for object creation ==="
pminfo -dfmtT bcc.proc.ustat.object 2>&1 | tee -a $seq_full \
| grep $javapid\" | _value_filter_nonzero
echo "=== report metric values for method calls ==="
pminfo -dfmtT bcc.proc.ustat.method 2>&1 | tee -a $seq_full \
| grep $javapid\" | _value_filter_nonzero
echo "=== report metric values for threads started ==="
pminfo -dfmtT bcc.proc.ustat.thread 2>&1 | tee -a $seq_full \
| grep $javapid\" | _value_filter_nonzero
$signal -s KILL $javapid > /dev/null 2>&1
_pmdabcc_remove 2>&1
status=0
exit
|