[LTP] Some question related LTP ftrace-stress-test

lihao4869 lihao4869@yeah.net
Mon Jun 8 15:01:46 CEST 2026



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.






More information about the ltp mailing list