In testcases/kernel/sched/tool/time-schedule, it used kill(0, SIGTERM) to terminate the all the processes in the group. However, the progress group leader might be different regarding the different call methods.
In interactive call such as pan, it called time-schedule by exec() and
setpgrp() as a child process. The time-schedule process would be the
process group leader and all the child processes created by it had the same
PGID. So the SIGTERM was sent to process group and the exit code got by pan
was 0.
In non-inactive call such as STAF/STAX, one shell script called the
time-schedule directly. The shell script would be the process group leader.
So the SIGTERM was also sent to the shell script and the exit code got by
STAF/STAX was 143 (128+15).
For example:
========================
Run time-schedule by pan
========================
<<<test_start>>>
tag=time-schedule01 stime=1219721252
cmdline=" time-schedule"
contacts=""
analysis=exit
initiation_status="ok"
<<<test_output>>>
Started 0 hog processes
Syscall overhead: 0.9 us
Number of yields: 21725
Num switches during overhead check: 0
Minimum scheduling latency: 0.4 (-0.5) us
Median scheduling latency: 0.5 (214748364.3) us
Average scheduling latency: 0.9 (0.0) us
Maximum scheduling latency: 251.6 (250.7) us
Run queue size: 2, 2
Num switches: 4
<<<execution_status>>>
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=1 cstime=1
<<<test_end>>>
======================
Run time-schedule by a.sh
======================
# cat a.sh
#!/bin/sh
./time-schedule
# ./a.sh
Started 0 hog processes
Syscall overhead: 0.9 us
Num switches during overhead check: 0
Minimum scheduling latency: 0.4 (-0.5) us
Number of yields: 18849
Median scheduling latency: 0.5 (214748364.3) us
Average scheduling latency: 0.6 (-0.3) us
Maximum scheduling latency: 145.8 (144.9) us
Run queue size: 2, 2
Num switches: 5
Terminated
# echo $?
143
This patch can resolve this problem.
Signed-off-by: Lin Feng Shen <[EMAIL PROTECTED]>
Signed-off-by: Jin Bing Guo <[EMAIL PROTECTED]>
------------
--- cvs_ltp.orig/testcases/kernel/sched/tool/time-schedule.c
2008-06-03 09:53:44.000000000 -0500
+++ cvs_ltp/testcases/kernel/sched/tool/time-schedule.c 2008-08-25
05:17:13.000000000 -0500
@@ -112,7 +112,8 @@ int main (int argc, char **argv)
sigset_t set;
static char *usage =
"time-schedule [-h] [-thread] [-notest] [-pipe] [-fpu]
[num_running]";
-
+
+ setpgrp();
/* First create pipe used to sychronise low priority processes */
if (pipe (fds) != 0)
{
(See attached file: Fix_PGID_time-schedule.patch)
Best regards!
Jin Bing Guo 郭晋兵
Linux for System p Test
IBM China Systems & Technology Laboratory in Beijing
Tel: +86-10-82454439
Email: [EMAIL PROTECTED]
-------------------------------------
"Do today what others won't so tomorrow you do what other's can't"
Fix_PGID_time-schedule.patch
Description: Binary data
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
