Skip to contentSkip to conversation

Some question related LTP ftrace-stress-test

LTP lihao4869 1 participant 1 message Jun 8

lore
Share & tools
lore

lihao4869

author
#0 lore raw

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.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp