^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #define TRACE_SYSTEM rtc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #if !defined(_TRACE_RTC_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define _TRACE_RTC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/rtc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) DECLARE_EVENT_CLASS(rtc_time_alarm_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) TP_PROTO(time64_t secs, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) TP_ARGS(secs, err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __field(time64_t, secs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __entry->secs = secs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) TP_printk("UTC (%lld) (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __entry->secs, __entry->err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) DEFINE_EVENT(rtc_time_alarm_class, rtc_set_time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_PROTO(time64_t secs, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) TP_ARGS(secs, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) DEFINE_EVENT(rtc_time_alarm_class, rtc_read_time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) TP_PROTO(time64_t secs, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) TP_ARGS(secs, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) DEFINE_EVENT(rtc_time_alarm_class, rtc_set_alarm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) TP_PROTO(time64_t secs, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) TP_ARGS(secs, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) DEFINE_EVENT(rtc_time_alarm_class, rtc_read_alarm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) TP_PROTO(time64_t secs, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) TP_ARGS(secs, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) TRACE_EVENT(rtc_irq_set_freq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) TP_PROTO(int freq, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) TP_ARGS(freq, err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __field(int, freq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) __entry->freq = freq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) TP_printk("set RTC periodic IRQ frequency:%u (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) __entry->freq, __entry->err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) TRACE_EVENT(rtc_irq_set_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) TP_PROTO(int enabled, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) TP_ARGS(enabled, err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) __field(int, enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) __entry->enabled = enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) TP_printk("%s RTC 2^N Hz periodic IRQs (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __entry->enabled ? "enable" : "disable",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __entry->err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) TRACE_EVENT(rtc_alarm_irq_enable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) TP_PROTO(unsigned int enabled, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) TP_ARGS(enabled, err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) __field(unsigned int, enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) __entry->enabled = enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) TP_printk("%s RTC alarm IRQ (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) __entry->enabled ? "enable" : "disable",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) __entry->err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) DECLARE_EVENT_CLASS(rtc_offset_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) TP_PROTO(long offset, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) TP_ARGS(offset, err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) __field(long, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) __entry->offset = offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) TP_printk("RTC offset: %ld (%d)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __entry->offset, __entry->err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) DEFINE_EVENT(rtc_offset_class, rtc_set_offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) TP_PROTO(long offset, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) TP_ARGS(offset, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) DEFINE_EVENT(rtc_offset_class, rtc_read_offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) TP_PROTO(long offset, int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) TP_ARGS(offset, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) DECLARE_EVENT_CLASS(rtc_timer_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) TP_PROTO(struct rtc_timer *timer),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) TP_ARGS(timer),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) __field(struct rtc_timer *, timer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) __field(ktime_t, expires)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) __field(ktime_t, period)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) __entry->timer = timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) __entry->expires = timer->node.expires;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) __entry->period = timer->period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) TP_printk("RTC timer:(%p) expires:%lld period:%lld",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) __entry->timer, __entry->expires, __entry->period
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) DEFINE_EVENT(rtc_timer_class, rtc_timer_enqueue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) TP_PROTO(struct rtc_timer *timer),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) TP_ARGS(timer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) DEFINE_EVENT(rtc_timer_class, rtc_timer_dequeue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) TP_PROTO(struct rtc_timer *timer),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) TP_ARGS(timer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) DEFINE_EVENT(rtc_timer_class, rtc_timer_fired,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) TP_PROTO(struct rtc_timer *timer),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) TP_ARGS(timer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #endif /* _TRACE_RTC_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #include <trace/define_trace.h>