trigger-synthetic-event-createremove.tc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. # description: event trigger - test synthetic event create remove
  3. do_reset() {
  4. reset_trigger
  5. echo > set_event
  6. clear_trace
  7. }
  8. fail() { #msg
  9. do_reset
  10. echo $1
  11. exit_fail
  12. }
  13. if [ ! -f set_event ]; then
  14. echo "event tracing is not supported"
  15. exit_unsupported
  16. fi
  17. if [ ! -f synthetic_events ]; then
  18. echo "synthetic event is not supported"
  19. exit_unsupported
  20. fi
  21. clear_synthetic_events
  22. reset_tracer
  23. do_reset
  24. echo "Test create synthetic event"
  25. echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events
  26. if [ ! -d events/synthetic/wakeup_latency ]; then
  27. fail "Failed to create wakeup_latency synthetic event"
  28. fi
  29. reset_trigger
  30. echo "Test create synthetic event with an error"
  31. echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null
  32. if [ -d events/synthetic/wakeup_latency ]; then
  33. fail "Created wakeup_latency synthetic event with an invalid format"
  34. fi
  35. reset_trigger
  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. do_reset
  42. exit 0