3 # pmie does not wait() for children ... defunct processes accummulate
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
15 trap "rm -f $tmp.*; exit 0" 0 1 2 3 15
19 $PCP_AWK_PROG -v pid
=$pmie_pid '
20 $5 == pid { n++ ; pidlist[n] = $4; next}
22 # output: <num> <pid> <pid>...
25 printf("%d ", pidlist[i]);
31 # real QA test starts here
32 tolerance
=10 # allow only one round of 100msec children to accumulate
34 cat <<End-of-File >$tmp.pmie
36 sample.long.ten >= 10 -> shell "date >>$tmp.log";
38 sample.long.ten >= 10 -> shell "ps -el >>$tmp.ps; echo '----' >>$tmp.ps";
41 pmie
-T 10 $tmp.pmie
>$tmp.out
2>$tmp.err
&
44 cat $tmp.out
$tmp.err | _show_pmie_errors
46 echo "== stdout ==" >$seq.full
47 cat $tmp.out
>>$seq.full
49 echo "== stderr ==" >>$seq.full
50 cat $tmp.err
>>$seq.full
52 _numchildren
< $tmp.ps
> $tmp.num
53 max
=`cut -d' ' -f1 < $tmp.num | LC_COLLATE=POSIX sort -nr | head -1 | sed -e 's/ *//g'`
55 # give the kernel a chance to catch its breath
59 ps
-el > $tmp.ps.final
61 max
=`cut -d' ' -f1 < $tmp.num | LC_COLLATE=POSIX sort -nr | head -1 | sed -e 's/ *//g'`
63 if [ "$max" -gt "$tolerance" ]
65 echo "There were too many child processes of pmie left over"
66 echo "In the worst case there were $max child processes"
67 echo "Running 1 second totals:"
71 # kernel may need more of a chance to catch up!
76 # Look for any of the pmie child processes left after pmie death
77 # They should all be dead
78 cat $tmp.num
>>$tmp.psawk
79 echo "----" >>$tmp.psawk
80 cat $tmp.ps.final
>>$tmp.psawk
81 $PCP_AWK_PROG < $tmp.psawk
'
84 # chuck all others in pidlist
89 $1 == "----" { final = 1; next }
91 # check if process in final ps is in pidlist
93 printf("process %s (pid=%d) is still alive\n",