WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-traceonoff.tc
blob9ca04678f4da54cea812ac2aec5abb5d42e2a812
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test traceon/off trigger
4 # requires: set_event events/sched/sched_process_fork/trigger
6 fail() { #msg
7 echo $1
8 exit_fail
11 echo "Test traceoff trigger"
12 echo 1 > tracing_on
13 echo 'traceoff' > events/sched/sched_process_fork/trigger
14 ( echo "forked")
15 if [ `cat tracing_on` -ne 0 ]; then
16 fail "traceoff trigger on sched_process_fork did not work"
19 reset_trigger
21 echo "Test traceon trigger"
22 echo 0 > tracing_on
23 echo 'traceon' > events/sched/sched_process_fork/trigger
24 ( echo "forked")
25 if [ `cat tracing_on` -ne 1 ]; then
26 fail "traceoff trigger on sched_process_fork did not work"
29 reset_trigger
31 echo "Test semantic error for traceoff/on trigger"
32 ! echo 'traceoff:badparam' > events/sched/sched_process_fork/trigger
33 ! echo 'traceoff+0' > events/sched/sched_process_fork/trigger
34 echo 'traceon' > events/sched/sched_process_fork/trigger
35 ! echo 'traceon' > events/sched/sched_process_fork/trigger
36 ! echo 'traceoff' > events/sched/sched_process_fork/trigger
38 exit 0