alarmtimer.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM alarmtimer
  4. #if !defined(_TRACE_ALARMTIMER_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_ALARMTIMER_H
  6. #include <linux/alarmtimer.h>
  7. #include <linux/rtc.h>
  8. #include <linux/tracepoint.h>
  9. TRACE_DEFINE_ENUM(ALARM_REALTIME);
  10. TRACE_DEFINE_ENUM(ALARM_BOOTTIME);
  11. TRACE_DEFINE_ENUM(ALARM_REALTIME_FREEZER);
  12. TRACE_DEFINE_ENUM(ALARM_BOOTTIME_FREEZER);
  13. #define show_alarm_type(type) __print_flags(type, " | ", \
  14. { 1 << ALARM_REALTIME, "REALTIME" }, \
  15. { 1 << ALARM_BOOTTIME, "BOOTTIME" }, \
  16. { 1 << ALARM_REALTIME_FREEZER, "REALTIME Freezer" }, \
  17. { 1 << ALARM_BOOTTIME_FREEZER, "BOOTTIME Freezer" })
  18. TRACE_EVENT(alarmtimer_suspend,
  19. TP_PROTO(ktime_t expires, int flag),
  20. TP_ARGS(expires, flag),
  21. TP_STRUCT__entry(
  22. __field(s64, expires)
  23. __field(unsigned char, alarm_type)
  24. ),
  25. TP_fast_assign(
  26. __entry->expires = expires;
  27. __entry->alarm_type = flag;
  28. ),
  29. TP_printk("alarmtimer type:%s expires:%llu",
  30. show_alarm_type((1 << __entry->alarm_type)),
  31. __entry->expires
  32. )
  33. );
  34. DECLARE_EVENT_CLASS(alarm_class,
  35. TP_PROTO(struct alarm *alarm, ktime_t now),
  36. TP_ARGS(alarm, now),
  37. TP_STRUCT__entry(
  38. __field(void *, alarm)
  39. __field(unsigned char, alarm_type)
  40. __field(s64, expires)
  41. __field(s64, now)
  42. ),
  43. TP_fast_assign(
  44. __entry->alarm = alarm;
  45. __entry->alarm_type = alarm->type;
  46. __entry->expires = alarm->node.expires;
  47. __entry->now = now;
  48. ),
  49. TP_printk("alarmtimer:%p type:%s expires:%llu now:%llu",
  50. __entry->alarm,
  51. show_alarm_type((1 << __entry->alarm_type)),
  52. __entry->expires,
  53. __entry->now
  54. )
  55. );
  56. DEFINE_EVENT(alarm_class, alarmtimer_fired,
  57. TP_PROTO(struct alarm *alarm, ktime_t now),
  58. TP_ARGS(alarm, now)
  59. );
  60. DEFINE_EVENT(alarm_class, alarmtimer_start,
  61. TP_PROTO(struct alarm *alarm, ktime_t now),
  62. TP_ARGS(alarm, now)
  63. );
  64. DEFINE_EVENT(alarm_class, alarmtimer_cancel,
  65. TP_PROTO(struct alarm *alarm, ktime_t now),
  66. TP_ARGS(alarm, now)
  67. );
  68. #endif /* _TRACE_ALARMTIMER_H */
  69. /* This part must be outside protection */
  70. #include <trace/define_trace.h>