rtc.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM rtc
  3. #if !defined(_TRACE_RTC_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_RTC_H
  5. #include <linux/rtc.h>
  6. #include <linux/tracepoint.h>
  7. DECLARE_EVENT_CLASS(rtc_time_alarm_class,
  8. TP_PROTO(time64_t secs, int err),
  9. TP_ARGS(secs, err),
  10. TP_STRUCT__entry(
  11. __field(time64_t, secs)
  12. __field(int, err)
  13. ),
  14. TP_fast_assign(
  15. __entry->secs = secs;
  16. __entry->err = err;
  17. ),
  18. TP_printk("UTC (%lld) (%d)",
  19. __entry->secs, __entry->err
  20. )
  21. );
  22. DEFINE_EVENT(rtc_time_alarm_class, rtc_set_time,
  23. TP_PROTO(time64_t secs, int err),
  24. TP_ARGS(secs, err)
  25. );
  26. DEFINE_EVENT(rtc_time_alarm_class, rtc_read_time,
  27. TP_PROTO(time64_t secs, int err),
  28. TP_ARGS(secs, err)
  29. );
  30. DEFINE_EVENT(rtc_time_alarm_class, rtc_set_alarm,
  31. TP_PROTO(time64_t secs, int err),
  32. TP_ARGS(secs, err)
  33. );
  34. DEFINE_EVENT(rtc_time_alarm_class, rtc_read_alarm,
  35. TP_PROTO(time64_t secs, int err),
  36. TP_ARGS(secs, err)
  37. );
  38. TRACE_EVENT(rtc_irq_set_freq,
  39. TP_PROTO(int freq, int err),
  40. TP_ARGS(freq, err),
  41. TP_STRUCT__entry(
  42. __field(int, freq)
  43. __field(int, err)
  44. ),
  45. TP_fast_assign(
  46. __entry->freq = freq;
  47. __entry->err = err;
  48. ),
  49. TP_printk("set RTC periodic IRQ frequency:%u (%d)",
  50. __entry->freq, __entry->err
  51. )
  52. );
  53. TRACE_EVENT(rtc_irq_set_state,
  54. TP_PROTO(int enabled, int err),
  55. TP_ARGS(enabled, err),
  56. TP_STRUCT__entry(
  57. __field(int, enabled)
  58. __field(int, err)
  59. ),
  60. TP_fast_assign(
  61. __entry->enabled = enabled;
  62. __entry->err = err;
  63. ),
  64. TP_printk("%s RTC 2^N Hz periodic IRQs (%d)",
  65. __entry->enabled ? "enable" : "disable",
  66. __entry->err
  67. )
  68. );
  69. TRACE_EVENT(rtc_alarm_irq_enable,
  70. TP_PROTO(unsigned int enabled, int err),
  71. TP_ARGS(enabled, err),
  72. TP_STRUCT__entry(
  73. __field(unsigned int, enabled)
  74. __field(int, err)
  75. ),
  76. TP_fast_assign(
  77. __entry->enabled = enabled;
  78. __entry->err = err;
  79. ),
  80. TP_printk("%s RTC alarm IRQ (%d)",
  81. __entry->enabled ? "enable" : "disable",
  82. __entry->err
  83. )
  84. );
  85. DECLARE_EVENT_CLASS(rtc_offset_class,
  86. TP_PROTO(long offset, int err),
  87. TP_ARGS(offset, err),
  88. TP_STRUCT__entry(
  89. __field(long, offset)
  90. __field(int, err)
  91. ),
  92. TP_fast_assign(
  93. __entry->offset = offset;
  94. __entry->err = err;
  95. ),
  96. TP_printk("RTC offset: %ld (%d)",
  97. __entry->offset, __entry->err
  98. )
  99. );
  100. DEFINE_EVENT(rtc_offset_class, rtc_set_offset,
  101. TP_PROTO(long offset, int err),
  102. TP_ARGS(offset, err)
  103. );
  104. DEFINE_EVENT(rtc_offset_class, rtc_read_offset,
  105. TP_PROTO(long offset, int err),
  106. TP_ARGS(offset, err)
  107. );
  108. DECLARE_EVENT_CLASS(rtc_timer_class,
  109. TP_PROTO(struct rtc_timer *timer),
  110. TP_ARGS(timer),
  111. TP_STRUCT__entry(
  112. __field(struct rtc_timer *, timer)
  113. __field(ktime_t, expires)
  114. __field(ktime_t, period)
  115. ),
  116. TP_fast_assign(
  117. __entry->timer = timer;
  118. __entry->expires = timer->node.expires;
  119. __entry->period = timer->period;
  120. ),
  121. TP_printk("RTC timer:(%p) expires:%lld period:%lld",
  122. __entry->timer, __entry->expires, __entry->period
  123. )
  124. );
  125. DEFINE_EVENT(rtc_timer_class, rtc_timer_enqueue,
  126. TP_PROTO(struct rtc_timer *timer),
  127. TP_ARGS(timer)
  128. );
  129. DEFINE_EVENT(rtc_timer_class, rtc_timer_dequeue,
  130. TP_PROTO(struct rtc_timer *timer),
  131. TP_ARGS(timer)
  132. );
  133. DEFINE_EVENT(rtc_timer_class, rtc_timer_fired,
  134. TP_PROTO(struct rtc_timer *timer),
  135. TP_ARGS(timer)
  136. );
  137. #endif /* _TRACE_RTC_H */
  138. /* This part must be outside protection */
  139. #include <trace/define_trace.h>