trigger-synthetic-event-createremove.tc 927 B

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