aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRiley Andrews <riandrews@google.com>2015-10-02 00:39:53 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-12-22 11:53:42 -0800
commitf734d2ce1bcdc2b8105a45e89c546b4a72c09b11 (patch)
tree65c7c5929c967331ed39c96cf7ad5136675860b2 /include
parent2195139276bb72516293bb8038d997fba90a497e (diff)
sched: add sched blocked tracepoint which dumps out context of sleep.
Decare war on uninterruptible sleep. Add a tracepoint which walks the kernel stack and dumps the first non-scheduler function called before the scheduler is invoked. Change-Id: I19e965d5206329360a92cbfe2afcc8c30f65c229 Signed-off-by: Riley Andrews <riandrews@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/sched.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index f65802c24b69..5abe3e4a2c7e 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -235,7 +235,7 @@ DECLARE_EVENT_CLASS(sched_process_template,
DEFINE_EVENT(sched_process_template, sched_process_free,
TP_PROTO(struct task_struct *p),
TP_ARGS(p));
-
+
/*
* Tracepoint for a task exiting:
@@ -390,6 +390,30 @@ DEFINE_EVENT(sched_stat_template, sched_stat_blocked,
TP_ARGS(tsk, delay));
/*
+ * Tracepoint for recording the cause of uninterruptible sleep.
+ */
+TRACE_EVENT(sched_blocked_reason,
+
+ TP_PROTO(struct task_struct *tsk),
+
+ TP_ARGS(tsk),
+
+ TP_STRUCT__entry(
+ __field( pid_t, pid )
+ __field( void*, caller )
+ __field( bool, io_wait )
+ ),
+
+ TP_fast_assign(
+ __entry->pid = tsk->pid;
+ __entry->caller = (void*)get_wchan(tsk);
+ __entry->io_wait = tsk->in_iowait;
+ ),
+
+ TP_printk("pid=%d iowait=%d caller=%pS", __entry->pid, __entry->io_wait, __entry->caller)
+);
+
+/*
* Tracepoint for accounting runtime (time the task is executing
* on a CPU).
*/