Merge tag 'for-linus-4.20a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[muen/linux.git] / tools / testing / selftests / ftrace / test.d / trigger / inter-event / trigger-synthetic-event-createremove.tc
1 #!/bin/sh
2 # description: event trigger - test synthetic event create remove
3
4 fail() { #msg
5     echo $1
6     exit_fail
7 }
8
9 if [ ! -f set_event ]; then
10     echo "event tracing is not supported"
11     exit_unsupported
12 fi
13
14 if [ ! -f synthetic_events ]; then
15     echo "synthetic event is not supported"
16     exit_unsupported
17 fi
18
19 echo "Test create synthetic event"
20
21 echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
22 if [ ! -d events/synthetic/wakeup_latency ]; then
23     fail "Failed to create wakeup_latency synthetic event"
24 fi
25
26 reset_trigger
27
28 echo "Test create synthetic event with an error"
29 echo 'wakeup_latency  u64 lat pid_t pid char' > synthetic_events > /dev/null
30 if [ -d events/synthetic/wakeup_latency ]; then
31     fail "Created wakeup_latency synthetic event with an invalid format"
32 fi
33
34 reset_trigger
35
36 echo "Test remove synthetic event"
37 echo '!wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
38 if [ -d events/synthetic/wakeup_latency ]; then
39     fail "Failed to delete wakeup_latency synthetic event"
40 fi
41
42 exit 0