Commit | Line | Data |
---|---|---|
f06eec4d | 1 | #!/bin/sh |
403726d8 | 2 | # SPDX-License-Identifier: GPL-2.0 |
f06eec4d | 3 | # description: event trigger - test synthetic event create remove |
3591e90f | 4 | # requires: set_event synthetic_events |
f06eec4d RJ |
5 | |
6 | fail() { #msg | |
f06eec4d RJ |
7 | echo $1 |
8 | exit_fail | |
9 | } | |
10 | ||
f06eec4d RJ |
11 | echo "Test create synthetic event" |
12 | ||
13 | echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events | |
14 | if [ ! -d events/synthetic/wakeup_latency ]; then | |
15 | fail "Failed to create wakeup_latency synthetic event" | |
16 | fi | |
17 | ||
18 | reset_trigger | |
19 | ||
0d0352d8 MH |
20 | echo "Test remove synthetic event" |
21 | echo '!wakeup_latency u64 lat pid_t pid char comm[16]' >> synthetic_events | |
f06eec4d | 22 | if [ -d events/synthetic/wakeup_latency ]; then |
0d0352d8 | 23 | fail "Failed to delete wakeup_latency synthetic event" |
f06eec4d RJ |
24 | fi |
25 | ||
26 | reset_trigger | |
27 | ||
0d0352d8 MH |
28 | echo "Test create synthetic event with an error" |
29 | echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null | |
f06eec4d | 30 | if [ -d events/synthetic/wakeup_latency ]; then |
0d0352d8 | 31 | fail "Created wakeup_latency synthetic event with an invalid format" |
f06eec4d RJ |
32 | fi |
33 | ||
f06eec4d | 34 | exit 0 |