File: 1150

package info (click to toggle)
pcp 7.0.5-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,916 kB
  • sloc: ansic: 1,478,844; sh: 177,285; xml: 160,462; cpp: 83,809; python: 24,349; perl: 18,303; yacc: 6,877; lex: 2,864; makefile: 2,694; awk: 165; fortran: 60; java: 52
file content (91 lines) | stat: -rwxr-xr-x 1,889 bytes parent folder | download
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
#!/bin/sh
# PCP QA Test No. 1150
# Exercise the BCC PMDA USDT hits module - install, remove and values.
#
# Copyright (c) 2018 Red Hat.
#

seq=`basename $0`
echo "QA output created by $seq"

. ./common.bcc

_pmdabcc_check
_pmdabcc_require_kernel_version 4 7

# If no PCP support for probes, also bail out
_get_libpcp_config
$static_probes || _notrun "No static probe support available in PCP build"

if [ -f /etc/lsb-release ]
then
    . /etc/lsb-release
    if [ "$DISTRIB_ID" = Ubuntu ]
    then
	# This test failed for Ubuntu 16.*, 17.* and 18.* but it
	# appears to work for 19.04, so assume others beyond this
	# release are also OK
	#
	version=`echo $DISTRIB_RELEASE | sed -e 's/\..*//'`
	if [ $version -lt 19 ]
	then
	    _notrun "bcc USDT does not work on Ubuntu $DISTRIB_RELEASE"
	fi
    fi
fi

status=1       # failure is the default!
signal=$PCP_BINADM_DIR/pmsignal

_log_filter()
{
    sed \
        -e 's,Using PID.*,Found PMCD.,g' \
	-e "s,$PCP_BINADM_DIR,PCP_BINADM_DIR,g" \
    #end
}

_value_filter()
{
    awk '/pmcd::recv_pdu/ && /value [1-9][0-9]*/ {print "OK"; exit}'
}

cat <<EOF >$tmp.conf
# Installed by PCP QA test $seq on `date`
[pmda]
modules = usdt_hits
prefix = bcc.
[usdt_hits]
module = usdt_hits
cluster = 101
process = pmcd
usdts = $PCP_BINADM_DIR/pmcd:recv_pdu,$PCP_BINADM_DIR/pmcd:xmit_pdu
EOF

_pmdabcc_try_compile $tmp.conf

_prepare_pmda bcc
trap "_pmdabcc_cleanup; exit \$status" 0 1 2 3 15
_stop_auto_restart pmcd

# real QA test starts here
_pmdabcc_install <$tmp.conf | _log_filter
if _pmdabcc_wait_for_metric
then
    echo "back from _pmdabcc_wait_for_metric: `date`" >>$seq_full
else
    exit
fi

# Generate system activity for the BCC uprobe hits module
pminfo -f bcc >>$seq_full
pminfo -f mem > /dev/null

echo "=== report metric values ==="
pminfo -dfmtT bcc.usdt.hits 2>&1 | tee -a $seq_full \
| _value_filter

_pmdabcc_remove

status=0
exit