diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-10-19 18:18:28 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-31 11:16:18 +0100 |
commit | 6a716c90a51338009c3bc1f460829afaed8f922d (patch) | |
tree | 85e821a30e0f9350a2b67ff94d758632eec92689 /include | |
parent | 4c4e4f61368164f326fe59e2156c70d7faa72c17 (diff) | |
download | linux-6a716c90a51338009c3bc1f460829afaed8f922d.tar.bz2 |
hung_task debugging: Add tracepoint to report the hang
Currently check_hung_task() prints a warning if it detects the
problem, but it is not convenient to watch the system logs if
user-space wants to be notified about the hang.
Add the new trace_sched_process_hang() into check_hung_task(),
this way a user-space monitor can easily wait for the hang and
potentially resolve a problem.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Dave Sullivan <dsulliva@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20131019161828.GA7439@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/trace/events/sched.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 2e7d9947a10d..2a652d124fbb 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -424,6 +424,25 @@ TRACE_EVENT(sched_pi_setprio, __entry->oldprio, __entry->newprio) ); +#ifdef CONFIG_DETECT_HUNG_TASK +TRACE_EVENT(sched_process_hang, + TP_PROTO(struct task_struct *tsk), + TP_ARGS(tsk), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->pid = tsk->pid; + ), + + TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid) +); +#endif /* CONFIG_DETECT_HUNG_TASK */ + #endif /* _TRACE_SCHED_H */ /* This part must be outside protection */ |