diff options
Diffstat (limited to 'include/trace/events/sched.h')
-rw-r--r-- | include/trace/events/sched.h | 107 |
1 files changed, 103 insertions, 4 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 8949bb7eb082..b48f1ad7c946 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -94,6 +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 | ), | 98 | ), |
98 | 99 | ||
99 | TP_fast_assign( | 100 | TP_fast_assign( |
@@ -101,11 +102,12 @@ TRACE_EVENT(sched_wakeup, | |||
101 | __entry->pid = p->pid; | 102 | __entry->pid = p->pid; |
102 | __entry->prio = p->prio; | 103 | __entry->prio = p->prio; |
103 | __entry->success = success; | 104 | __entry->success = success; |
105 | __entry->cpu = task_cpu(p); | ||
104 | ), | 106 | ), |
105 | 107 | ||
106 | TP_printk("task %s:%d [%d] success=%d", | 108 | TP_printk("task %s:%d [%d] success=%d [%03d]", |
107 | __entry->comm, __entry->pid, __entry->prio, | 109 | __entry->comm, __entry->pid, __entry->prio, |
108 | __entry->success) | 110 | __entry->success, __entry->cpu) |
109 | ); | 111 | ); |
110 | 112 | ||
111 | /* | 113 | /* |
@@ -125,6 +127,7 @@ TRACE_EVENT(sched_wakeup_new, | |||
125 | __field( pid_t, pid ) | 127 | __field( pid_t, pid ) |
126 | __field( int, prio ) | 128 | __field( int, prio ) |
127 | __field( int, success ) | 129 | __field( int, success ) |
130 | __field( int, cpu ) | ||
128 | ), | 131 | ), |
129 | 132 | ||
130 | TP_fast_assign( | 133 | TP_fast_assign( |
@@ -132,11 +135,12 @@ TRACE_EVENT(sched_wakeup_new, | |||
132 | __entry->pid = p->pid; | 135 | __entry->pid = p->pid; |
133 | __entry->prio = p->prio; | 136 | __entry->prio = p->prio; |
134 | __entry->success = success; | 137 | __entry->success = success; |
138 | __entry->cpu = task_cpu(p); | ||
135 | ), | 139 | ), |
136 | 140 | ||
137 | TP_printk("task %s:%d [%d] success=%d", | 141 | TP_printk("task %s:%d [%d] success=%d [%03d]", |
138 | __entry->comm, __entry->pid, __entry->prio, | 142 | __entry->comm, __entry->pid, __entry->prio, |
139 | __entry->success) | 143 | __entry->success, __entry->cpu) |
140 | ); | 144 | ); |
141 | 145 | ||
142 | /* | 146 | /* |
@@ -340,6 +344,101 @@ TRACE_EVENT(sched_signal_send, | |||
340 | __entry->sig, __entry->comm, __entry->pid) | 344 | __entry->sig, __entry->comm, __entry->pid) |
341 | ); | 345 | ); |
342 | 346 | ||
347 | /* | ||
348 | * 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. | ||
350 | */ | ||
351 | |||
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 | |||
358 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
359 | |||
360 | TP_ARGS(tsk, delay), | ||
361 | |||
362 | TP_STRUCT__entry( | ||
363 | __array( char, comm, TASK_COMM_LEN ) | ||
364 | __field( pid_t, pid ) | ||
365 | __field( u64, delay ) | ||
366 | ), | ||
367 | |||
368 | TP_fast_assign( | ||
369 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
370 | __entry->pid = tsk->pid; | ||
371 | __entry->delay = delay; | ||
372 | ) | ||
373 | TP_perf_assign( | ||
374 | __perf_count(delay); | ||
375 | ), | ||
376 | |||
377 | TP_printk("task: %s:%d wait: %Lu [ns]", | ||
378 | __entry->comm, __entry->pid, | ||
379 | (unsigned long long)__entry->delay) | ||
380 | ); | ||
381 | |||
382 | /* | ||
383 | * Tracepoint for accounting sleep time (time the task is not runnable, | ||
384 | * including iowait, see below). | ||
385 | */ | ||
386 | TRACE_EVENT(sched_stat_sleep, | ||
387 | |||
388 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
389 | |||
390 | TP_ARGS(tsk, delay), | ||
391 | |||
392 | TP_STRUCT__entry( | ||
393 | __array( char, comm, TASK_COMM_LEN ) | ||
394 | __field( pid_t, pid ) | ||
395 | __field( u64, delay ) | ||
396 | ), | ||
397 | |||
398 | TP_fast_assign( | ||
399 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
400 | __entry->pid = tsk->pid; | ||
401 | __entry->delay = delay; | ||
402 | ) | ||
403 | TP_perf_assign( | ||
404 | __perf_count(delay); | ||
405 | ), | ||
406 | |||
407 | TP_printk("task: %s:%d sleep: %Lu [ns]", | ||
408 | __entry->comm, __entry->pid, | ||
409 | (unsigned long long)__entry->delay) | ||
410 | ); | ||
411 | |||
412 | /* | ||
413 | * Tracepoint for accounting iowait time (time the task is not runnable | ||
414 | * due to waiting on IO to complete). | ||
415 | */ | ||
416 | TRACE_EVENT(sched_stat_iowait, | ||
417 | |||
418 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
419 | |||
420 | TP_ARGS(tsk, delay), | ||
421 | |||
422 | TP_STRUCT__entry( | ||
423 | __array( char, comm, TASK_COMM_LEN ) | ||
424 | __field( pid_t, pid ) | ||
425 | __field( u64, delay ) | ||
426 | ), | ||
427 | |||
428 | TP_fast_assign( | ||
429 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
430 | __entry->pid = tsk->pid; | ||
431 | __entry->delay = delay; | ||
432 | ) | ||
433 | TP_perf_assign( | ||
434 | __perf_count(delay); | ||
435 | ), | ||
436 | |||
437 | TP_printk("task: %s:%d iowait: %Lu [ns]", | ||
438 | __entry->comm, __entry->pid, | ||
439 | (unsigned long long)__entry->delay) | ||
440 | ); | ||
441 | |||
343 | #endif /* _TRACE_SCHED_H */ | 442 | #endif /* _TRACE_SCHED_H */ |
344 | 443 | ||
345 | /* This part must be outside protection */ | 444 | /* This part must be outside protection */ |