3 # Check pmcd static probes
5 # Copyright (c) 2013-2014 Red Hat.
8 echo "QA output created by $seq"
10 # get standard environment, filters and checks
15 status
=0 # success is the default!
16 $sudo rm -fr $tmp.
* $seq.full
17 trap "rm -fr $tmp.*; exit \$status" 0 1 2 3 15
19 # If no systemtap, we cannot run the script
20 which stap
>/dev
/null
2>&1 || _notrun
"No systemtap stap executable found"
22 # If no PCP support for probes, also bail out
24 $static_probes || _notrun
"No static probe support available in PCP build"
26 # If running in FIPS mode, we cannot run this either
28 fips_stsfile
="/proc/sys/crypto/fips_enabled"
29 [ -f $fips_stsfile ] && fips_enabled
=`cat $fips_stsfile`
30 test $fips_enabled -eq 0 || _notrun
"FIPS enabled, no kernel stap testing"
32 # real QA test starts here
33 cat <<End-of-File >$tmp.stap
36 system("pminfo -f hinv >/dev/null")
37 system("pminfo -f kernel >/dev/null")
38 system("pminfo -d mem >/dev/null")
39 system("pminfo -f network >/dev/null")
40 system("pminfo -tT disk >/dev/null")
42 probe process("$PCP_BINADM_DIR/pmcd").mark("*") {
45 probe timer.ms(1000) {
46 if (@count(probe_hits) > 0)
53 echo "Using stap config:" >> $seq.full
54 cat $tmp.stap
>> $seq.full
55 echo "Running pmcd process:" >> $seq.full
56 $PCP_PS_PROG $PCP_PS_ALL_FLAGS |
grep pmcd
>> $seq.full
58 # check for stap user probing support
59 stap
-p4 $tmp.stap
>$tmp.out
2>&1
62 echo "Systemtap compile check failed"
63 cat $tmp.out
>> $seq.full
64 _notrun
"Systemtap userspace probing unsupported here"
67 # start systemtap and count pmcd probe hits
68 echo "Fire stap probes:" >> $seq.full
69 $sudo stap
$tmp.stap
>$tmp.out
2>&1
70 cat $tmp.out |
tee -a $seq.full
72 echo "Output from stap:" >> $seq.full
73 cat $tmp.out
>> $seq.full