staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-snapshot.tc
blob7717c0a096867de6b2bb1af8f12c5b2c0272296c
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test snapshot-trigger
5 fail() { #msg
6 echo $1
7 exit_fail
10 if [ ! -f set_event -o ! -d events/sched ]; then
11 echo "event tracing is not supported"
12 exit_unsupported
15 if [ ! -f events/sched/sched_process_fork/trigger ]; then
16 echo "event trigger is not supported"
17 exit_unsupported
20 if [ ! -f snapshot ]; then
21 echo "snapshot is not supported"
22 exit_unsupported
25 FEATURE=`grep snapshot events/sched/sched_process_fork/trigger`
26 if [ -z "$FEATURE" ]; then
27 echo "snapshot trigger is not supported"
28 exit_unsupported
31 echo "Test snapshot tigger"
32 echo 0 > snapshot
33 echo 1 > events/sched/sched_process_fork/enable
34 ( echo "forked")
35 echo 'snapshot:1' > events/sched/sched_process_fork/trigger
36 ( echo "forked")
37 grep sched_process_fork snapshot > /dev/null || \
38 fail "snapshot trigger on sched_process_fork did not work"
40 reset_trigger
41 echo 0 > snapshot
42 echo 0 > events/sched/sched_process_fork/enable
44 echo "Test snapshot semantic errors"
46 ! echo "snapshot+1" > events/sched/sched_process_fork/trigger
47 echo "snapshot" > events/sched/sched_process_fork/trigger
48 ! echo "snapshot" > events/sched/sched_process_fork/trigger
50 exit 0