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_PLATFORM = linux || _notrun
"Test unsupported on $PCP_PLATFORM"
19 test -f /proc
/$pid/cgroup || _notrun
"No per-process support for cgroups"
21 status
=1 # failure is the default!
22 $sudo rm -rf $tmp.
* $seq.full
23 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
25 # real QA test starts here
27 syscgroups
=`cat /proc/$pid/cgroup \
28 | sed -e 's/^[0-9][0-9]*://' \
31 echo "SYS cgroup list for process $pid is: $syscgroups" >> $seq.full
33 pminfo
-f proc.psinfo.cgroups
> $tmp.cgroups
34 pcpcgroups
=`grep "^ inst \[$pid or " $tmp.cgroups \
35 | $PCP_AWK_PROG '{ print $NF }' \
36 | sed -e 's/^"//' -e 's/"$//'`
37 echo "PCP cgroup list for process $pid is: $pcpcgroups" >> $seq.full
38 echo "Extracted from pminfo:" >> $seq.full
39 cat $tmp.cgroups
>> $seq.full
41 if [ "$pcpcgroups" = "$syscgroups" ]
43 echo "Control group list for current process checks out"
46 echo "Mismatch on control group list:"
47 echo "PCP cgroups: $pcpcgroups"
48 echo "SYS cgroups: $syscgroups"