3 # Exercise pmdaproc per-process metric extraction.
5 # Copyright (c) 2015-2016 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 pminfo proc.nprocs
>/dev
/null
2>&1 || _notrun
"proc PMDA not installed"
17 [ $PCP_PLATFORM = linux
] || _notrun
"Linux proc test, only works with Linux"
19 status
=1 # failure is the default!
20 $sudo rm -rf $tmp.
* $seq.full
21 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
26 grep -v 'inst \[' $tmp.out
27 sed -n -e 's/inst \[[0-9][0-9]*/inst [N/p' $tmp.out \
28 | LC_COLLATE
=POSIX
sort
31 # real QA test starts here
33 export PROC_STATSPATH
=$root
34 export PROC_PAGESIZE
=4096
37 pmda
=$PCP_PMDAS_DIR/proc
/pmda_proc.so
,proc_init
39 for tgz
in $here/linux
/procpid-
*-root-*.tgz
43 mkdir
$root || _fail
"root in use when processing $tgz"
48 echo "== Extracting subtrees for later use - $base" |
tee -a $seq.full
49 trees
=`pminfo proc | awk -F. '{ print $2 }' | sort -u | egrep -v nproc`
50 echo $trees >> $here/$seq.full
52 echo "== Checking namespace and metric numbering - $base"
53 pminfo
-L -K clear -K add
,3,$pmda proc \
54 | LC_COLLATE
=POSIX
sort \
55 |
tee $tmp.names
>> $here/$seq.full
57 echo "== Checking metric descriptors and a fetch - $base"
60 metric
=`grep $tree $tmp.names | head -1`
61 echo $metric >> $here/$seq.full
62 pminfo
-L -K clear -K add
,3,$pmda -d -f $metric | _filter
65 echo && echo "== done" && echo