1 #!/bin/sh 1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 2 # SPDX-License-Identifier: GPL-2.0 3 # description: event trigger - test traceon/of 3 # description: event trigger - test traceon/off trigger 4 # requires: set_event events/sched/sched_proce 4 # requires: set_event events/sched/sched_process_fork/trigger 5 5 6 fail() { #msg 6 fail() { #msg 7 echo $1 7 echo $1 8 exit_fail 8 exit_fail 9 } 9 } 10 10 11 echo "Test traceoff trigger" 11 echo "Test traceoff trigger" 12 echo 1 > tracing_on 12 echo 1 > tracing_on 13 echo 'traceoff' > events/sched/sched_process_f 13 echo 'traceoff' > events/sched/sched_process_fork/trigger 14 ( echo "forked") 14 ( echo "forked") 15 if [ `cat tracing_on` -ne 0 ]; then 15 if [ `cat tracing_on` -ne 0 ]; then 16 fail "traceoff trigger on sched_process_fo 16 fail "traceoff trigger on sched_process_fork did not work" 17 fi 17 fi 18 18 19 reset_trigger 19 reset_trigger 20 20 21 echo "Test traceon trigger" 21 echo "Test traceon trigger" 22 echo 0 > tracing_on 22 echo 0 > tracing_on 23 echo 'traceon' > events/sched/sched_process_fo 23 echo 'traceon' > events/sched/sched_process_fork/trigger 24 ( echo "forked") 24 ( echo "forked") 25 if [ `cat tracing_on` -ne 1 ]; then 25 if [ `cat tracing_on` -ne 1 ]; then 26 fail "traceoff trigger on sched_process_fo 26 fail "traceoff trigger on sched_process_fork did not work" 27 fi 27 fi 28 28 29 reset_trigger 29 reset_trigger 30 30 31 echo "Test semantic error for traceoff/on trig 31 echo "Test semantic error for traceoff/on trigger" 32 ! echo 'traceoff:badparam' > events/sched/sche 32 ! echo 'traceoff:badparam' > events/sched/sched_process_fork/trigger 33 ! echo 'traceoff+0' > events/sched/sched_proce 33 ! echo 'traceoff+0' > events/sched/sched_process_fork/trigger 34 echo 'traceon' > events/sched/sched_process_fo 34 echo 'traceon' > events/sched/sched_process_fork/trigger 35 ! echo 'traceon' > events/sched/sched_process_ 35 ! echo 'traceon' > events/sched/sched_process_fork/trigger 36 ! echo 'traceoff' > events/sched/sched_process 36 ! echo 'traceoff' > events/sched/sched_process_fork/trigger 37 37 38 exit 0 38 exit 0
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.