Some question related LTP ftrace-stress-test

lihao4869 <lihao4869-Mj/[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>

Hello,
  I noticed that in the LTP test case ftrace-stress-test, the script ftrace_trace_pipe.shis executed.
  In the second while loop, the variable this_pidis assigned the value 0. Is this reasonable?
  Because when this_pid is 0 and ftrace_trace_pipe.sh receives a SIGUSR1 signal, the trapped handler will execute kill -KILL 0, which sends SIGKILL to the entire process group. As a result, the parent process ftrace_stress_test.sh is killed, ultimately causing the test to fail.


script is as follow:
kill_this_pid()
{
        kill -KILL $this_pid
        wait $this_pid
        exit 0
}


trap kill_this_pid SIGUSR1


LOOP=20


while true; do
        i=0
        while [ $i -lt $LOOP ]; do
                cat "$TRACING_PATH"/trace_pipe > /dev/null &
                this_pid=$!


                tst_sleep 200000us


                kill -INT $this_pid
                wait $this_pid


                this_pid=0


                tst_sleep 200000us


                i=$((i + 1))
        done
        sleep 2
done


Looking forward to your reply.





-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.