diff options
Diffstat (limited to 'include/trace/events/sched.h')
-rw-r--r-- | include/trace/events/sched.h | 217 |
1 files changed, 60 insertions, 157 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 4069c43f4187..cfceb0b73e20 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -26,7 +26,7 @@ TRACE_EVENT(sched_kthread_stop, | |||
26 | __entry->pid = t->pid; | 26 | __entry->pid = t->pid; |
27 | ), | 27 | ), |
28 | 28 | ||
29 | TP_printk("task %s:%d", __entry->comm, __entry->pid) | 29 | TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid) |
30 | ); | 30 | ); |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -46,7 +46,7 @@ TRACE_EVENT(sched_kthread_stop_ret, | |||
46 | __entry->ret = ret; | 46 | __entry->ret = ret; |
47 | ), | 47 | ), |
48 | 48 | ||
49 | TP_printk("ret %d", __entry->ret) | 49 | TP_printk("ret=%d", __entry->ret) |
50 | ); | 50 | ); |
51 | 51 | ||
52 | /* | 52 | /* |
@@ -73,7 +73,7 @@ TRACE_EVENT(sched_wait_task, | |||
73 | __entry->prio = p->prio; | 73 | __entry->prio = p->prio; |
74 | ), | 74 | ), |
75 | 75 | ||
76 | TP_printk("task %s:%d [%d]", | 76 | TP_printk("comm=%s pid=%d prio=%d", |
77 | __entry->comm, __entry->pid, __entry->prio) | 77 | __entry->comm, __entry->pid, __entry->prio) |
78 | ); | 78 | ); |
79 | 79 | ||
@@ -83,7 +83,7 @@ TRACE_EVENT(sched_wait_task, | |||
83 | * (NOTE: the 'rq' argument is not used by generic trace events, | 83 | * (NOTE: the 'rq' argument is not used by generic trace events, |
84 | * but used by the latency tracer plugin. ) | 84 | * but used by the latency tracer plugin. ) |
85 | */ | 85 | */ |
86 | TRACE_EVENT(sched_wakeup, | 86 | DECLARE_EVENT_CLASS(sched_wakeup_template, |
87 | 87 | ||
88 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 88 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), |
89 | 89 | ||
@@ -94,7 +94,7 @@ TRACE_EVENT(sched_wakeup, | |||
94 | __field( pid_t, pid ) | 94 | __field( pid_t, pid ) |
95 | __field( int, prio ) | 95 | __field( int, prio ) |
96 | __field( int, success ) | 96 | __field( int, success ) |
97 | __field( int, cpu ) | 97 | __field( int, target_cpu ) |
98 | ), | 98 | ), |
99 | 99 | ||
100 | TP_fast_assign( | 100 | TP_fast_assign( |
@@ -102,46 +102,27 @@ TRACE_EVENT(sched_wakeup, | |||
102 | __entry->pid = p->pid; | 102 | __entry->pid = p->pid; |
103 | __entry->prio = p->prio; | 103 | __entry->prio = p->prio; |
104 | __entry->success = success; | 104 | __entry->success = success; |
105 | __entry->cpu = task_cpu(p); | 105 | __entry->target_cpu = task_cpu(p); |
106 | ), | 106 | ), |
107 | 107 | ||
108 | TP_printk("task %s:%d [%d] success=%d [%03d]", | 108 | TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d", |
109 | __entry->comm, __entry->pid, __entry->prio, | 109 | __entry->comm, __entry->pid, __entry->prio, |
110 | __entry->success, __entry->cpu) | 110 | __entry->success, __entry->target_cpu) |
111 | ); | 111 | ); |
112 | 112 | ||
113 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup, | ||
114 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | ||
115 | TP_ARGS(rq, p, success)); | ||
116 | |||
113 | /* | 117 | /* |
114 | * Tracepoint for waking up a new task: | 118 | * Tracepoint for waking up a new task: |
115 | * | 119 | * |
116 | * (NOTE: the 'rq' argument is not used by generic trace events, | 120 | * (NOTE: the 'rq' argument is not used by generic trace events, |
117 | * but used by the latency tracer plugin. ) | 121 | * but used by the latency tracer plugin. ) |
118 | */ | 122 | */ |
119 | TRACE_EVENT(sched_wakeup_new, | 123 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, |
120 | 124 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | |
121 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 125 | TP_ARGS(rq, p, success)); |
122 | |||
123 | TP_ARGS(rq, p, success), | ||
124 | |||
125 | TP_STRUCT__entry( | ||
126 | __array( char, comm, TASK_COMM_LEN ) | ||
127 | __field( pid_t, pid ) | ||
128 | __field( int, prio ) | ||
129 | __field( int, success ) | ||
130 | __field( int, cpu ) | ||
131 | ), | ||
132 | |||
133 | TP_fast_assign( | ||
134 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
135 | __entry->pid = p->pid; | ||
136 | __entry->prio = p->prio; | ||
137 | __entry->success = success; | ||
138 | __entry->cpu = task_cpu(p); | ||
139 | ), | ||
140 | |||
141 | TP_printk("task %s:%d [%d] success=%d [%03d]", | ||
142 | __entry->comm, __entry->pid, __entry->prio, | ||
143 | __entry->success, __entry->cpu) | ||
144 | ); | ||
145 | 126 | ||
146 | /* | 127 | /* |
147 | * Tracepoint for task switches, performed by the scheduler: | 128 | * Tracepoint for task switches, performed by the scheduler: |
@@ -176,7 +157,7 @@ TRACE_EVENT(sched_switch, | |||
176 | __entry->next_prio = next->prio; | 157 | __entry->next_prio = next->prio; |
177 | ), | 158 | ), |
178 | 159 | ||
179 | TP_printk("task %s:%d [%d] (%s) ==> %s:%d [%d]", | 160 | TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d next_prio=%d", |
180 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | 161 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, |
181 | __entry->prev_state ? | 162 | __entry->prev_state ? |
182 | __print_flags(__entry->prev_state, "|", | 163 | __print_flags(__entry->prev_state, "|", |
@@ -211,15 +192,12 @@ TRACE_EVENT(sched_migrate_task, | |||
211 | __entry->dest_cpu = dest_cpu; | 192 | __entry->dest_cpu = dest_cpu; |
212 | ), | 193 | ), |
213 | 194 | ||
214 | TP_printk("task %s:%d [%d] from: %d to: %d", | 195 | TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d", |
215 | __entry->comm, __entry->pid, __entry->prio, | 196 | __entry->comm, __entry->pid, __entry->prio, |
216 | __entry->orig_cpu, __entry->dest_cpu) | 197 | __entry->orig_cpu, __entry->dest_cpu) |
217 | ); | 198 | ); |
218 | 199 | ||
219 | /* | 200 | DECLARE_EVENT_CLASS(sched_process_template, |
220 | * Tracepoint for freeing a task: | ||
221 | */ | ||
222 | TRACE_EVENT(sched_process_free, | ||
223 | 201 | ||
224 | TP_PROTO(struct task_struct *p), | 202 | TP_PROTO(struct task_struct *p), |
225 | 203 | ||
@@ -237,34 +215,24 @@ TRACE_EVENT(sched_process_free, | |||
237 | __entry->prio = p->prio; | 215 | __entry->prio = p->prio; |
238 | ), | 216 | ), |
239 | 217 | ||
240 | TP_printk("task %s:%d [%d]", | 218 | TP_printk("comm=%s pid=%d prio=%d", |
241 | __entry->comm, __entry->pid, __entry->prio) | 219 | __entry->comm, __entry->pid, __entry->prio) |
242 | ); | 220 | ); |
243 | 221 | ||
244 | /* | 222 | /* |
245 | * Tracepoint for a task exiting: | 223 | * Tracepoint for freeing a task: |
246 | */ | 224 | */ |
247 | TRACE_EVENT(sched_process_exit, | 225 | DEFINE_EVENT(sched_process_template, sched_process_free, |
226 | TP_PROTO(struct task_struct *p), | ||
227 | TP_ARGS(p)); | ||
228 | |||
248 | 229 | ||
249 | TP_PROTO(struct task_struct *p), | 230 | /* |
250 | 231 | * Tracepoint for a task exiting: | |
251 | TP_ARGS(p), | 232 | */ |
252 | 233 | DEFINE_EVENT(sched_process_template, sched_process_exit, | |
253 | TP_STRUCT__entry( | 234 | TP_PROTO(struct task_struct *p), |
254 | __array( char, comm, TASK_COMM_LEN ) | 235 | TP_ARGS(p)); |
255 | __field( pid_t, pid ) | ||
256 | __field( int, prio ) | ||
257 | ), | ||
258 | |||
259 | TP_fast_assign( | ||
260 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
261 | __entry->pid = p->pid; | ||
262 | __entry->prio = p->prio; | ||
263 | ), | ||
264 | |||
265 | TP_printk("task %s:%d [%d]", | ||
266 | __entry->comm, __entry->pid, __entry->prio) | ||
267 | ); | ||
268 | 236 | ||
269 | /* | 237 | /* |
270 | * Tracepoint for a waiting task: | 238 | * Tracepoint for a waiting task: |
@@ -287,7 +255,7 @@ TRACE_EVENT(sched_process_wait, | |||
287 | __entry->prio = current->prio; | 255 | __entry->prio = current->prio; |
288 | ), | 256 | ), |
289 | 257 | ||
290 | TP_printk("task %s:%d [%d]", | 258 | TP_printk("comm=%s pid=%d prio=%d", |
291 | __entry->comm, __entry->pid, __entry->prio) | 259 | __entry->comm, __entry->pid, __entry->prio) |
292 | ); | 260 | ); |
293 | 261 | ||
@@ -314,46 +282,16 @@ TRACE_EVENT(sched_process_fork, | |||
314 | __entry->child_pid = child->pid; | 282 | __entry->child_pid = child->pid; |
315 | ), | 283 | ), |
316 | 284 | ||
317 | TP_printk("parent %s:%d child %s:%d", | 285 | TP_printk("comm=%s pid=%d child_comm=%s child_pid=%d", |
318 | __entry->parent_comm, __entry->parent_pid, | 286 | __entry->parent_comm, __entry->parent_pid, |
319 | __entry->child_comm, __entry->child_pid) | 287 | __entry->child_comm, __entry->child_pid) |
320 | ); | 288 | ); |
321 | 289 | ||
322 | /* | 290 | /* |
323 | * Tracepoint for sending a signal: | ||
324 | */ | ||
325 | TRACE_EVENT(sched_signal_send, | ||
326 | |||
327 | TP_PROTO(int sig, struct task_struct *p), | ||
328 | |||
329 | TP_ARGS(sig, p), | ||
330 | |||
331 | TP_STRUCT__entry( | ||
332 | __field( int, sig ) | ||
333 | __array( char, comm, TASK_COMM_LEN ) | ||
334 | __field( pid_t, pid ) | ||
335 | ), | ||
336 | |||
337 | TP_fast_assign( | ||
338 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
339 | __entry->pid = p->pid; | ||
340 | __entry->sig = sig; | ||
341 | ), | ||
342 | |||
343 | TP_printk("sig: %d task %s:%d", | ||
344 | __entry->sig, __entry->comm, __entry->pid) | ||
345 | ); | ||
346 | |||
347 | /* | ||
348 | * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE | 291 | * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE |
349 | * adding sched_stat support to SCHED_FIFO/RR would be welcome. | 292 | * adding sched_stat support to SCHED_FIFO/RR would be welcome. |
350 | */ | 293 | */ |
351 | 294 | DECLARE_EVENT_CLASS(sched_stat_template, | |
352 | /* | ||
353 | * Tracepoint for accounting wait time (time the task is runnable | ||
354 | * but not actually running due to scheduler contention). | ||
355 | */ | ||
356 | TRACE_EVENT(sched_stat_wait, | ||
357 | 295 | ||
358 | TP_PROTO(struct task_struct *tsk, u64 delay), | 296 | TP_PROTO(struct task_struct *tsk, u64 delay), |
359 | 297 | ||
@@ -374,11 +312,36 @@ TRACE_EVENT(sched_stat_wait, | |||
374 | __perf_count(delay); | 312 | __perf_count(delay); |
375 | ), | 313 | ), |
376 | 314 | ||
377 | TP_printk("task: %s:%d wait: %Lu [ns]", | 315 | TP_printk("comm=%s pid=%d delay=%Lu [ns]", |
378 | __entry->comm, __entry->pid, | 316 | __entry->comm, __entry->pid, |
379 | (unsigned long long)__entry->delay) | 317 | (unsigned long long)__entry->delay) |
380 | ); | 318 | ); |
381 | 319 | ||
320 | |||
321 | /* | ||
322 | * Tracepoint for accounting wait time (time the task is runnable | ||
323 | * but not actually running due to scheduler contention). | ||
324 | */ | ||
325 | DEFINE_EVENT(sched_stat_template, sched_stat_wait, | ||
326 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
327 | TP_ARGS(tsk, delay)); | ||
328 | |||
329 | /* | ||
330 | * Tracepoint for accounting sleep time (time the task is not runnable, | ||
331 | * including iowait, see below). | ||
332 | */ | ||
333 | DEFINE_EVENT(sched_stat_template, sched_stat_sleep, | ||
334 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
335 | TP_ARGS(tsk, delay)); | ||
336 | |||
337 | /* | ||
338 | * Tracepoint for accounting iowait time (time the task is not runnable | ||
339 | * due to waiting on IO to complete). | ||
340 | */ | ||
341 | DEFINE_EVENT(sched_stat_template, sched_stat_iowait, | ||
342 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
343 | TP_ARGS(tsk, delay)); | ||
344 | |||
382 | /* | 345 | /* |
383 | * Tracepoint for accounting runtime (time the task is executing | 346 | * Tracepoint for accounting runtime (time the task is executing |
384 | * on a CPU). | 347 | * on a CPU). |
@@ -406,72 +369,12 @@ TRACE_EVENT(sched_stat_runtime, | |||
406 | __perf_count(runtime); | 369 | __perf_count(runtime); |
407 | ), | 370 | ), |
408 | 371 | ||
409 | TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]", | 372 | TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]", |
410 | __entry->comm, __entry->pid, | 373 | __entry->comm, __entry->pid, |
411 | (unsigned long long)__entry->runtime, | 374 | (unsigned long long)__entry->runtime, |
412 | (unsigned long long)__entry->vruntime) | 375 | (unsigned long long)__entry->vruntime) |
413 | ); | 376 | ); |
414 | 377 | ||
415 | /* | ||
416 | * Tracepoint for accounting sleep time (time the task is not runnable, | ||
417 | * including iowait, see below). | ||
418 | */ | ||
419 | TRACE_EVENT(sched_stat_sleep, | ||
420 | |||
421 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
422 | |||
423 | TP_ARGS(tsk, delay), | ||
424 | |||
425 | TP_STRUCT__entry( | ||
426 | __array( char, comm, TASK_COMM_LEN ) | ||
427 | __field( pid_t, pid ) | ||
428 | __field( u64, delay ) | ||
429 | ), | ||
430 | |||
431 | TP_fast_assign( | ||
432 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
433 | __entry->pid = tsk->pid; | ||
434 | __entry->delay = delay; | ||
435 | ) | ||
436 | TP_perf_assign( | ||
437 | __perf_count(delay); | ||
438 | ), | ||
439 | |||
440 | TP_printk("task: %s:%d sleep: %Lu [ns]", | ||
441 | __entry->comm, __entry->pid, | ||
442 | (unsigned long long)__entry->delay) | ||
443 | ); | ||
444 | |||
445 | /* | ||
446 | * Tracepoint for accounting iowait time (time the task is not runnable | ||
447 | * due to waiting on IO to complete). | ||
448 | */ | ||
449 | TRACE_EVENT(sched_stat_iowait, | ||
450 | |||
451 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
452 | |||
453 | TP_ARGS(tsk, delay), | ||
454 | |||
455 | TP_STRUCT__entry( | ||
456 | __array( char, comm, TASK_COMM_LEN ) | ||
457 | __field( pid_t, pid ) | ||
458 | __field( u64, delay ) | ||
459 | ), | ||
460 | |||
461 | TP_fast_assign( | ||
462 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
463 | __entry->pid = tsk->pid; | ||
464 | __entry->delay = delay; | ||
465 | ) | ||
466 | TP_perf_assign( | ||
467 | __perf_count(delay); | ||
468 | ), | ||
469 | |||
470 | TP_printk("task: %s:%d iowait: %Lu [ns]", | ||
471 | __entry->comm, __entry->pid, | ||
472 | (unsigned long long)__entry->delay) | ||
473 | ); | ||
474 | |||
475 | #endif /* _TRACE_SCHED_H */ | 378 | #endif /* _TRACE_SCHED_H */ |
476 | 379 | ||
477 | /* This part must be outside protection */ | 380 | /* This part must be outside protection */ |