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 | |
| 39 | /** |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 40 | * timer_start - called when the timer is started |
| 41 | * @timer: pointer to struct timer_list |
| 42 | * @expires: the timers expiry time |
| 43 | */ |
| 44 | TRACE_EVENT(timer_start, |
| 45 | |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame^] | 46 | TP_PROTO(struct timer_list *timer, |
| 47 | unsigned long expires, |
| 48 | unsigned int deferrable), |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 49 | |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame^] | 50 | TP_ARGS(timer, expires, deferrable), |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 51 | |
| 52 | TP_STRUCT__entry( |
| 53 | __field( void *, timer ) |
| 54 | __field( void *, function ) |
| 55 | __field( unsigned long, expires ) |
| 56 | __field( unsigned long, now ) |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame^] | 57 | __field( unsigned int, deferrable ) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 58 | ), |
| 59 | |
| 60 | TP_fast_assign( |
| 61 | __entry->timer = timer; |
| 62 | __entry->function = timer->function; |
| 63 | __entry->expires = expires; |
| 64 | __entry->now = jiffies; |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame^] | 65 | __entry->deferrable = deferrable; |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 66 | ), |
| 67 | |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame^] | 68 | TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] defer=%c", |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 69 | __entry->timer, __entry->function, __entry->expires, |
Badhri Jagan Sridharan | 4e413e8 | 2015-05-07 16:20:34 -0700 | [diff] [blame^] | 70 | (long)__entry->expires - __entry->now, |
| 71 | __entry->deferrable > 0 ? 'y':'n') |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 72 | ); |
| 73 | |
| 74 | /** |
| 75 | * timer_expire_entry - called immediately before the timer callback |
| 76 | * @timer: pointer to struct timer_list |
| 77 | * |
| 78 | * Allows to determine the timer latency. |
| 79 | */ |
| 80 | TRACE_EVENT(timer_expire_entry, |
| 81 | |
| 82 | TP_PROTO(struct timer_list *timer), |
| 83 | |
| 84 | TP_ARGS(timer), |
| 85 | |
| 86 | TP_STRUCT__entry( |
| 87 | __field( void *, timer ) |
| 88 | __field( unsigned long, now ) |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 89 | __field( void *, function) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 90 | ), |
| 91 | |
| 92 | TP_fast_assign( |
| 93 | __entry->timer = timer; |
| 94 | __entry->now = jiffies; |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 95 | __entry->function = timer->function; |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 96 | ), |
| 97 | |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 98 | 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] | 99 | ); |
| 100 | |
| 101 | /** |
| 102 | * timer_expire_exit - called immediately after the timer callback returns |
| 103 | * @timer: pointer to struct timer_list |
| 104 | * |
| 105 | * When used in combination with the timer_expire_entry tracepoint we can |
| 106 | * determine the runtime of the timer callback function. |
| 107 | * |
| 108 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might |
| 109 | * be invalid. We solely track the pointer. |
| 110 | */ |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 111 | DEFINE_EVENT(timer_class, timer_expire_exit, |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 112 | |
| 113 | TP_PROTO(struct timer_list *timer), |
| 114 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 115 | TP_ARGS(timer) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 116 | ); |
| 117 | |
| 118 | /** |
| 119 | * timer_cancel - called when the timer is canceled |
| 120 | * @timer: pointer to struct timer_list |
| 121 | */ |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 122 | DEFINE_EVENT(timer_class, timer_cancel, |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 123 | |
| 124 | TP_PROTO(struct timer_list *timer), |
| 125 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 126 | TP_ARGS(timer) |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 127 | ); |
| 128 | |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 129 | /** |
| 130 | * hrtimer_init - called when the hrtimer is initialized |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 131 | * @hrtimer: pointer to struct hrtimer |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 132 | * @clockid: the hrtimers clock |
| 133 | * @mode: the hrtimers mode |
| 134 | */ |
| 135 | TRACE_EVENT(hrtimer_init, |
| 136 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 137 | TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 138 | enum hrtimer_mode mode), |
| 139 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 140 | TP_ARGS(hrtimer, clockid, mode), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 141 | |
| 142 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 143 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 144 | __field( clockid_t, clockid ) |
| 145 | __field( enum hrtimer_mode, mode ) |
| 146 | ), |
| 147 | |
| 148 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 149 | __entry->hrtimer = hrtimer; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 150 | __entry->clockid = clockid; |
| 151 | __entry->mode = mode; |
| 152 | ), |
| 153 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 154 | TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 155 | __entry->clockid == CLOCK_REALTIME ? |
| 156 | "CLOCK_REALTIME" : "CLOCK_MONOTONIC", |
| 157 | __entry->mode == HRTIMER_MODE_ABS ? |
| 158 | "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL") |
| 159 | ); |
| 160 | |
| 161 | /** |
| 162 | * hrtimer_start - called when the hrtimer is started |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 163 | * @hrtimer: pointer to struct hrtimer |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 164 | */ |
| 165 | TRACE_EVENT(hrtimer_start, |
| 166 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 167 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 168 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 169 | TP_ARGS(hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 170 | |
| 171 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 172 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 173 | __field( void *, function ) |
| 174 | __field( s64, expires ) |
| 175 | __field( s64, softexpires ) |
| 176 | ), |
| 177 | |
| 178 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 179 | __entry->hrtimer = hrtimer; |
| 180 | __entry->function = hrtimer->function; |
| 181 | __entry->expires = hrtimer_get_expires(hrtimer).tv64; |
| 182 | __entry->softexpires = hrtimer_get_softexpires(hrtimer).tv64; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 183 | ), |
| 184 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 185 | TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu", |
| 186 | __entry->hrtimer, __entry->function, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 187 | (unsigned long long)ktime_to_ns((ktime_t) { |
| 188 | .tv64 = __entry->expires }), |
| 189 | (unsigned long long)ktime_to_ns((ktime_t) { |
| 190 | .tv64 = __entry->softexpires })) |
| 191 | ); |
| 192 | |
| 193 | /** |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 194 | * hrtimer_expire_entry - called immediately before the hrtimer callback |
| 195 | * @hrtimer: pointer to struct hrtimer |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 196 | * @now: pointer to variable which contains current time of the |
| 197 | * timers base. |
| 198 | * |
| 199 | * Allows to determine the timer latency. |
| 200 | */ |
| 201 | TRACE_EVENT(hrtimer_expire_entry, |
| 202 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 203 | TP_PROTO(struct hrtimer *hrtimer, ktime_t *now), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 204 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 205 | TP_ARGS(hrtimer, now), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 206 | |
| 207 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 208 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 209 | __field( s64, now ) |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 210 | __field( void *, function) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 211 | ), |
| 212 | |
| 213 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 214 | __entry->hrtimer = hrtimer; |
| 215 | __entry->now = now->tv64; |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 216 | __entry->function = hrtimer->function; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 217 | ), |
| 218 | |
Arjan van de Ven | ede1b42 | 2010-08-18 15:33:13 -0700 | [diff] [blame] | 219 | TP_printk("hrtimer=%p function=%pf now=%llu", __entry->hrtimer, __entry->function, |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 220 | (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 221 | ); |
| 222 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 223 | DECLARE_EVENT_CLASS(hrtimer_class, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 224 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 225 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 226 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 227 | TP_ARGS(hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 228 | |
| 229 | TP_STRUCT__entry( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 230 | __field( void *, hrtimer ) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 231 | ), |
| 232 | |
| 233 | TP_fast_assign( |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 234 | __entry->hrtimer = hrtimer; |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 235 | ), |
| 236 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 237 | TP_printk("hrtimer=%p", __entry->hrtimer) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 238 | ); |
| 239 | |
| 240 | /** |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 241 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns |
Masanari Iida | cf2fbdd | 2013-03-16 20:53:05 +0900 | [diff] [blame] | 242 | * @hrtimer: pointer to struct hrtimer |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 243 | * |
| 244 | * When used in combination with the hrtimer_expire_entry tracepoint we can |
| 245 | * determine the runtime of the callback function. |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 246 | */ |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 247 | DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 248 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 249 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 250 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 251 | TP_ARGS(hrtimer) |
| 252 | ); |
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 | /** |
| 255 | * hrtimer_cancel - called when the hrtimer is canceled |
| 256 | * @hrtimer: pointer to struct hrtimer |
| 257 | */ |
| 258 | DEFINE_EVENT(hrtimer_class, hrtimer_cancel, |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 259 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 260 | TP_PROTO(struct hrtimer *hrtimer), |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 261 | |
Li Zefan | 363d0f6 | 2010-05-24 16:23:15 +0800 | [diff] [blame] | 262 | TP_ARGS(hrtimer) |
Xiao Guangrong | c6a2a17 | 2009-08-10 10:51:23 +0800 | [diff] [blame] | 263 | ); |
| 264 | |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 265 | /** |
| 266 | * itimer_state - called when itimer is started or canceled |
| 267 | * @which: name of the interval timer |
| 268 | * @value: the itimers value, itimer is canceled if value->it_value is |
| 269 | * zero, otherwise it is started |
| 270 | * @expires: the itimers expiry time |
| 271 | */ |
| 272 | TRACE_EVENT(itimer_state, |
| 273 | |
| 274 | TP_PROTO(int which, const struct itimerval *const value, |
| 275 | cputime_t expires), |
| 276 | |
| 277 | TP_ARGS(which, value, expires), |
| 278 | |
| 279 | TP_STRUCT__entry( |
| 280 | __field( int, which ) |
| 281 | __field( cputime_t, expires ) |
| 282 | __field( long, value_sec ) |
| 283 | __field( long, value_usec ) |
| 284 | __field( long, interval_sec ) |
| 285 | __field( long, interval_usec ) |
| 286 | ), |
| 287 | |
| 288 | TP_fast_assign( |
| 289 | __entry->which = which; |
| 290 | __entry->expires = expires; |
| 291 | __entry->value_sec = value->it_value.tv_sec; |
| 292 | __entry->value_usec = value->it_value.tv_usec; |
| 293 | __entry->interval_sec = value->it_interval.tv_sec; |
| 294 | __entry->interval_usec = value->it_interval.tv_usec; |
| 295 | ), |
| 296 | |
Thomas Gleixner | e9c0748 | 2009-12-10 13:23:19 +0100 | [diff] [blame] | 297 | TP_printk("which=%d expires=%llu it_value=%ld.%ld it_interval=%ld.%ld", |
| 298 | __entry->which, (unsigned long long)__entry->expires, |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 299 | __entry->value_sec, __entry->value_usec, |
| 300 | __entry->interval_sec, __entry->interval_usec) |
| 301 | ); |
| 302 | |
| 303 | /** |
| 304 | * itimer_expire - called when itimer expires |
| 305 | * @which: type of the interval timer |
| 306 | * @pid: pid of the process which owns the timer |
| 307 | * @now: current time, used to calculate the latency of itimer |
| 308 | */ |
| 309 | TRACE_EVENT(itimer_expire, |
| 310 | |
| 311 | TP_PROTO(int which, struct pid *pid, cputime_t now), |
| 312 | |
| 313 | TP_ARGS(which, pid, now), |
| 314 | |
| 315 | TP_STRUCT__entry( |
| 316 | __field( int , which ) |
| 317 | __field( pid_t, pid ) |
| 318 | __field( cputime_t, now ) |
| 319 | ), |
| 320 | |
| 321 | TP_fast_assign( |
| 322 | __entry->which = which; |
| 323 | __entry->now = now; |
| 324 | __entry->pid = pid_nr(pid); |
| 325 | ), |
| 326 | |
Thomas Gleixner | e9c0748 | 2009-12-10 13:23:19 +0100 | [diff] [blame] | 327 | TP_printk("which=%d pid=%d now=%llu", __entry->which, |
| 328 | (int) __entry->pid, (unsigned long long)__entry->now) |
Xiao Guangrong | 3f0a525 | 2009-08-10 10:52:30 +0800 | [diff] [blame] | 329 | ); |
| 330 | |
Frederic Weisbecker | 2c82d1be | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 331 | #ifdef CONFIG_NO_HZ_COMMON |
Frederic Weisbecker | cb41a29 | 2013-04-20 17:35:50 +0200 | [diff] [blame] | 332 | TRACE_EVENT(tick_stop, |
| 333 | |
| 334 | TP_PROTO(int success, char *error_msg), |
| 335 | |
| 336 | TP_ARGS(success, error_msg), |
| 337 | |
| 338 | TP_STRUCT__entry( |
| 339 | __field( int , success ) |
| 340 | __string( msg, error_msg ) |
| 341 | ), |
| 342 | |
| 343 | TP_fast_assign( |
| 344 | __entry->success = success; |
| 345 | __assign_str(msg, error_msg); |
| 346 | ), |
| 347 | |
| 348 | TP_printk("success=%s msg=%s", __entry->success ? "yes" : "no", __get_str(msg)) |
| 349 | ); |
| 350 | #endif |
| 351 | |
Xiao Guangrong | 2b022e3 | 2009-08-10 10:48:59 +0800 | [diff] [blame] | 352 | #endif /* _TRACE_TIMER_H */ |
| 353 | |
| 354 | /* This part must be outside protection */ |
| 355 | #include <trace/define_trace.h> |