3 # Exercise the Linux kernel proc.psinfo.cgroup metric
5 # Copyright (c) 2013 Red Hat. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
18 test $PCP_VER -ge 30805 || _notrun
"No support for new proc cgroup metric"
19 test $PCP_PLATFORM = linux || _notrun
"Test unsupported on $PCP_PLATFORM"
20 test -f /proc
/$pid/cgroup || _notrun
"No per-process support for cgroups"
22 status
=1 # failure is the default!
23 $sudo rm -rf $tmp.
* $seq.full
24 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
26 # real QA test starts here
28 syscgroups
=`cat /proc/$pid/cgroup \
29 | sed -e 's/^[0-9][0-9]*://' \
32 echo "SYS cgroup list for process $pid is: $syscgroups" >> $seq.full
34 pminfo
-f proc.psinfo.cgroups
> $tmp.cgroups
35 pcpcgroups
=`grep "^ inst \[$pid or " $tmp.cgroups \
36 | $PCP_AWK_PROG '{ print $NF }' \
37 | sed -e 's/^"//' -e 's/"$//'`
38 echo "PCP cgroup list for process $pid is: $pcpcgroups" >> $seq.full
39 echo "Extracted from pminfo:" >> $seq.full
40 cat $tmp.cgroups
>> $seq.full
42 if [ "$pcpcgroups" = "$syscgroups" ]
44 echo "Control group list for current process checks out"
47 echo "Mismatch on control group list:"
48 echo "PCP cgroups: $pcpcgroups"
49 echo "SYS cgroups: $syscgroups"