Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM timer |
| 3 | |
| 4 | #if !defined(_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_TIMER_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 8 | #include <linux/hrtimer.h> |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 9 | #include <linux/timer.h> |
| 10 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 11 | DECLARE_EVENT_CLASS(timer_class, |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 12 | |
| 13 | TP_PROTO(struct timer_list *timer), |
| 14 | |
| 15 | TP_ARGS(timer), |
| 16 | |
| 17 | TP_STRUCT__entry( |
| 18 | __field( void *, timer ) |
| 19 | ), |
| 20 | |
| 21 | TP_fast_assign( |
| 22 | __entry->timer = timer; |
| 23 | ), |
| 24 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 25 | TP_printk("timer=%p", __entry->timer) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 26 | ); |
| 27 | |
| 28 | /** |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 29 | * timer_init - called when the timer is initialized |
| 30 | * @timer: pointer to struct timer_list |
| 31 | */ |
| 32 | DEFINE_EVENT(timer_class, timer_init, |
| 33 | |
| 34 | TP_PROTO(struct timer_list *timer), |
| 35 | |
| 36 | TP_ARGS(timer) |
| 37 | ); |
| 38 | |
Thomas Gleixner | 8a58a34 | 2017-02-10 16:41:15 +0100 | [diff] [blame] | 39 | #define decode_timer_flags(flags) \ |
| 40 | __print_flags(flags, "|", \ |
| 41 | { TIMER_MIGRATING, "M" }, \ |
| 42 | { TIMER_DEFERRABLE, "D" }, \ |
| 43 | { TIMER_PINNED, "P" }, \ |
| 44 | { TIMER_IRQSAFE, "I" }) |
| 45 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 46 | /** |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 47 | * timer_start - called when the timer is started |
| 48 | * @timer: pointer to struct timer_list |
| 49 | * @expires: the timers expiry time |
| 50 | */ |
| 51 | TRACE_EVENT(timer_start, |
| 52 | |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame] | 53 | TP_PROTO(struct timer_list *timer, |
| 54 | unsigned long expires, |
Thomas Gleixner | 0eeda71 | 2015-05-26 22:50:29 +0000 | [diff] [blame] | 55 | unsigned int flags), |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 56 | |
Thomas Gleixner | 0eeda71 | 2015-05-26 22:50:29 +0000 | [diff] [blame] | 57 | TP_ARGS(timer, expires, flags), |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 58 | |
| 59 | TP_STRUCT__entry( |
| 60 | __field( void *, timer ) |
| 61 | __field( void *, function ) |
| 62 | __field( unsigned long, expires ) |
| 63 | __field( unsigned long, now ) |
Thomas Gleixner | 0eeda71 | 2015-05-26 22:50:29 +0000 | [diff] [blame] | 64 | __field( unsigned int, flags ) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 65 | ), |
| 66 | |
| 67 | TP_fast_assign( |
| 68 | __entry->timer = timer; |
| 69 | __entry->function = timer->function; |
| 70 | __entry->expires = expires; |
| 71 | __entry->now = jiffies; |
Thomas Gleixner | 0eeda71 | 2015-05-26 22:50:29 +0000 | [diff] [blame] | 72 | __entry->flags = flags; |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 73 | ), |
| 74 | |
Thomas Gleixner | 8a58a34 | 2017-02-10 16:41:15 +0100 | [diff] [blame] | 75 | TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] cpu=%u idx=%u flags=%s", |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 76 | __entry->timer, __entry->function, __entry->expires, |
Thomas Gleixner | 8a58a34 | 2017-02-10 16:41:15 +0100 | [diff] [blame] | 77 | (long)__entry->expires - __entry->now, |
| 78 | __entry->flags & TIMER_CPUMASK, |
| 79 | __entry->flags >> TIMER_ARRAYSHIFT, |
| 80 | decode_timer_flags(__entry->flags & TIMER_TRACE_FLAGMASK)) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 81 | ); |
| 82 | |
| 83 | /** |
| 84 | * timer_expire_entry - called immediately before the timer callback |
| 85 | * @timer: pointer to struct timer_list |
| 86 | * |
| 87 | * Allows to determine the timer latency. |
| 88 | */ |
| 89 | TRACE_EVENT(timer_expire_entry, |
| 90 | |
| 91 | TP_PROTO(struct timer_list *timer), |
| 92 | |
| 93 | TP_ARGS(timer), |
| 94 | |
| 95 | TP_STRUCT__entry( |
| 96 | __field( void *, timer ) |
| 97 | __field( unsigned long, now ) |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 98 | __field( void *, function) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 99 | ), |
| 100 | |
| 101 | TP_fast_assign( |
| 102 | __entry->timer = timer; |
| 103 | __entry->now = jiffies; |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 104 | __entry->function = timer->function; |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 105 | ), |
| 106 | |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 107 | TP_printk("timer=%p function=%pf now=%lu", __entry->timer, __entry->function,__entry->now) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 108 | ); |
| 109 | |
| 110 | /** |
| 111 | * timer_expire_exit - called immediately after the timer callback returns |
| 112 | * @timer: pointer to struct timer_list |
| 113 | * |
| 114 | * When used in combination with the timer_expire_entry tracepoint we can |
| 115 | * determine the runtime of the timer callback function. |
| 116 | * |
| 117 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might |
| 118 | * be invalid. We solely track the pointer. |
| 119 | */ |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 120 | DEFINE_EVENT(timer_class, timer_expire_exit, |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 121 | |
| 122 | TP_PROTO(struct timer_list *timer), |
| 123 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 124 | TP_ARGS(timer) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 125 | ); |
| 126 | |
| 127 | /** |
| 128 | * timer_cancel - called when the timer is canceled |
| 129 | * @timer: pointer to struct timer_list |
| 130 | */ |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 131 | DEFINE_EVENT(timer_class, timer_cancel, |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 132 | |
| 133 | TP_PROTO(struct timer_list *timer), |
| 134 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 135 | TP_ARGS(timer) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 136 | ); |
| 137 | |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 138 | /** |
| 139 | * hrtimer_init - called when the hrtimer is initialized |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 140 | * @hrtimer: pointer to struct hrtimer |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 141 | * @clockid: the hrtimers clock |
| 142 | * @mode: the hrtimers mode |
| 143 | */ |
| 144 | TRACE_EVENT(hrtimer_init, |
| 145 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 146 | TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 147 | enum hrtimer_mode mode), |
| 148 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 149 | TP_ARGS(hrtimer, clockid, mode), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 150 | |
| 151 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 152 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 153 | __field( clockid_t, clockid ) |
| 154 | __field( enum hrtimer_mode, mode ) |
| 155 | ), |
| 156 | |
| 157 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 158 | __entry->hrtimer = hrtimer; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 159 | __entry->clockid = clockid; |
| 160 | __entry->mode = mode; |
| 161 | ), |
| 162 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 163 | TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 164 | __entry->clockid == CLOCK_REALTIME ? |
| 165 | "CLOCK_REALTIME" : "CLOCK_MONOTONIC", |
| 166 | __entry->mode == HRTIMER_MODE_ABS ? |
| 167 | "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL") |
| 168 | ); |
| 169 | |
| 170 | /** |
| 171 | * hrtimer_start - called when the hrtimer is started |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 172 | * @hrtimer: pointer to struct hrtimer |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 173 | */ |
| 174 | TRACE_EVENT(hrtimer_start, |
| 175 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 176 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 177 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 178 | TP_ARGS(hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 179 | |
| 180 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 181 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 182 | __field( void *, function ) |
| 183 | __field( s64, expires ) |
| 184 | __field( s64, softexpires ) |
| 185 | ), |
| 186 | |
| 187 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 188 | __entry->hrtimer = hrtimer; |
| 189 | __entry->function = hrtimer->function; |
Thomas Gleixner | 2456e85 | 2016-12-25 11:38:40 +0100 | [diff] [blame] | 190 | __entry->expires = hrtimer_get_expires(hrtimer); |
| 191 | __entry->softexpires = hrtimer_get_softexpires(hrtimer); |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 192 | ), |
| 193 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 194 | TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu", |
| 195 | __entry->hrtimer, __entry->function, |
Thomas Gleixner | 2456e85 | 2016-12-25 11:38:40 +0100 | [diff] [blame] | 196 | (unsigned long long) __entry->expires, |
| 197 | (unsigned long long) __entry->softexpires) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 198 | ); |
| 199 | |
| 200 | /** |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 201 | * hrtimer_expire_entry - called immediately before the hrtimer callback |
| 202 | * @hrtimer: pointer to struct hrtimer |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 203 | * @now: pointer to variable which contains current time of the |
| 204 | * timers base. |
| 205 | * |
| 206 | * Allows to determine the timer latency. |
| 207 | */ |
| 208 | TRACE_EVENT(hrtimer_expire_entry, |
| 209 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 210 | TP_PROTO(struct hrtimer *hrtimer, ktime_t *now), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 211 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 212 | TP_ARGS(hrtimer, now), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 213 | |
| 214 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 215 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 216 | __field( s64, now ) |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 217 | __field( void *, function) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 218 | ), |
| 219 | |
| 220 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 221 | __entry->hrtimer = hrtimer; |
Thomas Gleixner | 2456e85 | 2016-12-25 11:38:40 +0100 | [diff] [blame] | 222 | __entry->now = *now; |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 223 | __entry->function = hrtimer->function; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 224 | ), |
| 225 | |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 226 | TP_printk("hrtimer=%p function=%pf now=%llu", __entry->hrtimer, __entry->function, |
Thomas Gleixner | 2456e85 | 2016-12-25 11:38:40 +0100 | [diff] [blame] | 227 | (unsigned long long) __entry->now) |
| 228 | ); |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 229 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 230 | DECLARE_EVENT_CLASS(hrtimer_class, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 231 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 232 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 233 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 234 | TP_ARGS(hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 235 | |
| 236 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 237 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 238 | ), |
| 239 | |
| 240 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 241 | __entry->hrtimer = hrtimer; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 242 | ), |
| 243 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 244 | TP_printk("hrtimer=%p", __entry->hrtimer) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 245 | ); |
| 246 | |
| 247 | /** |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 248 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 249 | * @hrtimer: pointer to struct hrtimer |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 250 | * |
| 251 | * When used in combination with the hrtimer_expire_entry tracepoint we can |
| 252 | * determine the runtime of the callback function. |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 253 | */ |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 254 | DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 255 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 256 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 257 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 258 | TP_ARGS(hrtimer) |
| 259 | ); |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 260 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 261 | /** |
| 262 | * hrtimer_cancel - called when the hrtimer is canceled |
| 263 | * @hrtimer: pointer to struct hrtimer |
| 264 | */ |
| 265 | DEFINE_EVENT(hrtimer_class, hrtimer_cancel, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 266 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 267 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 268 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 269 | TP_ARGS(hrtimer) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 270 | ); |
| 271 | |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 272 | /** |
| 273 | * itimer_state - called when itimer is started or canceled |
| 274 | * @which: name of the interval timer |
| 275 | * @value: the itimers value, itimer is canceled if value->it_value is |
| 276 | * zero, otherwise it is started |
| 277 | * @expires: the itimers expiry time |
| 278 | */ |
| 279 | TRACE_EVENT(itimer_state, |
| 280 | |
| 281 | TP_PROTO(int which, const struct itimerval *const value, |
Frederic Weisbecker | 858cf3a | 2017-01-31 04:09:35 +0100 | [diff] [blame] | 282 | unsigned long long expires), |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 283 | |
| 284 | TP_ARGS(which, value, expires), |
| 285 | |
| 286 | TP_STRUCT__entry( |
Frederic Weisbecker | 858cf3a | 2017-01-31 04:09:35 +0100 | [diff] [blame] | 287 | __field( int, which ) |
| 288 | __field( unsigned long long, expires ) |
| 289 | __field( long, value_sec ) |
| 290 | __field( long, value_usec ) |
| 291 | __field( long, interval_sec ) |
| 292 | __field( long, interval_usec ) |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 293 | ), |
| 294 | |
| 295 | TP_fast_assign( |
| 296 | __entry->which = which; |
| 297 | __entry->expires = expires; |
| 298 | __entry->value_sec = value->it_value.tv_sec; |
| 299 | __entry->value_usec = value->it_value.tv_usec; |
| 300 | __entry->interval_sec = value->it_interval.tv_sec; |
| 301 | __entry->interval_usec = value->it_interval.tv_usec; |
| 302 | ), |
| 303 | |
Thomas Gleixner | e9c0748b | 2009-12-10 13:23:19 +0100 | [diff] [blame] | 304 | TP_printk("which=%d expires=%llu it_value=%ld.%ld it_interval=%ld.%ld", |
Frederic Weisbecker | 858cf3a | 2017-01-31 04:09:35 +0100 | [diff] [blame] | 305 | __entry->which, __entry->expires, |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 306 | __entry->value_sec, __entry->value_usec, |
| 307 | __entry->interval_sec, __entry->interval_usec) |
| 308 | ); |
| 309 | |
| 310 | /** |
| 311 | * itimer_expire - called when itimer expires |
| 312 | * @which: type of the interval timer |
| 313 | * @pid: pid of the process which owns the timer |
| 314 | * @now: current time, used to calculate the latency of itimer |
| 315 | */ |
| 316 | TRACE_EVENT(itimer_expire, |
| 317 | |
Frederic Weisbecker | 858cf3a | 2017-01-31 04:09:35 +0100 | [diff] [blame] | 318 | TP_PROTO(int which, struct pid *pid, unsigned long long now), |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 319 | |
| 320 | TP_ARGS(which, pid, now), |
| 321 | |
| 322 | TP_STRUCT__entry( |
Frederic Weisbecker | 858cf3a | 2017-01-31 04:09:35 +0100 | [diff] [blame] | 323 | __field( int , which ) |
| 324 | __field( pid_t, pid ) |
| 325 | __field( unsigned long long, now ) |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 326 | ), |
| 327 | |
| 328 | TP_fast_assign( |
| 329 | __entry->which = which; |
| 330 | __entry->now = now; |
| 331 | __entry->pid = pid_nr(pid); |
| 332 | ), |
| 333 | |
Thomas Gleixner | e9c0748b | 2009-12-10 13:23:19 +0100 | [diff] [blame] | 334 | TP_printk("which=%d pid=%d now=%llu", __entry->which, |
Frederic Weisbecker | 858cf3a | 2017-01-31 04:09:35 +0100 | [diff] [blame] | 335 | (int) __entry->pid, __entry->now) |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 336 | ); |
| 337 | |
Frederic Weisbecker | 2c82d1be | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 338 | #ifdef CONFIG_NO_HZ_COMMON |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 339 | |
| 340 | #define TICK_DEP_NAMES \ |
Steven Rostedt (Red Hat) | c87edb3 | 2016-08-05 12:41:52 -0400 | [diff] [blame] | 341 | tick_dep_mask_name(NONE) \ |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 342 | tick_dep_name(POSIX_TIMER) \ |
| 343 | tick_dep_name(PERF_EVENTS) \ |
| 344 | tick_dep_name(SCHED) \ |
| 345 | tick_dep_name_end(CLOCK_UNSTABLE) |
| 346 | |
| 347 | #undef tick_dep_name |
Steven Rostedt (Red Hat) | c87edb3 | 2016-08-05 12:41:52 -0400 | [diff] [blame] | 348 | #undef tick_dep_mask_name |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 349 | #undef tick_dep_name_end |
| 350 | |
Steven Rostedt (Red Hat) | c87edb3 | 2016-08-05 12:41:52 -0400 | [diff] [blame] | 351 | /* The MASK will convert to their bits and they need to be processed too */ |
| 352 | #define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \ |
| 353 | TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep); |
| 354 | #define tick_dep_name_end(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \ |
| 355 | TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep); |
| 356 | /* NONE only has a mask defined for it */ |
| 357 | #define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep); |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 358 | |
| 359 | TICK_DEP_NAMES |
| 360 | |
| 361 | #undef tick_dep_name |
Steven Rostedt (Red Hat) | c87edb3 | 2016-08-05 12:41:52 -0400 | [diff] [blame] | 362 | #undef tick_dep_mask_name |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 363 | #undef tick_dep_name_end |
| 364 | |
| 365 | #define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep }, |
Steven Rostedt (Red Hat) | c87edb3 | 2016-08-05 12:41:52 -0400 | [diff] [blame] | 366 | #define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep }, |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 367 | #define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep } |
| 368 | |
| 369 | #define show_tick_dep_name(val) \ |
| 370 | __print_symbolic(val, TICK_DEP_NAMES) |
| 371 | |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 372 | TRACE_EVENT(tick_stop, |
| 373 | |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 374 | TP_PROTO(int success, int dependency), |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 375 | |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 376 | TP_ARGS(success, dependency), |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 377 | |
| 378 | TP_STRUCT__entry( |
| 379 | __field( int , success ) |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 380 | __field( int , dependency ) |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 381 | ), |
| 382 | |
| 383 | TP_fast_assign( |
| 384 | __entry->success = success; |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 385 | __entry->dependency = dependency; |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 386 | ), |
| 387 | |
Frederic Weisbecker | e6e6cc2 | 2015-12-11 03:27:25 +0100 | [diff] [blame] | 388 | TP_printk("success=%d dependency=%s", __entry->success, \ |
| 389 | show_tick_dep_name(__entry->dependency)) |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 390 | ); |
| 391 | #endif |
| 392 | |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 393 | #endif /* _TRACE_TIMER_H */ |
| 394 | |
| 395 | /* This part must be outside protection */ |
| 396 | #include <trace/define_trace.h> |