diff options
author | Richard Braun <rbraun@sceen.net> | 2017-03-04 16:35:58 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-03-04 16:56:18 +0100 |
commit | 82b40129690ac7aa122e09bda56d105cdc1371a1 (patch) | |
tree | 3fc8132de6adf7d671ddeb6d671abd3e79e30ccb /kern/task.c | |
parent | 9dcbb0c5beccab3e2142e722149bdb95627beee2 (diff) |
kern/task: improve task_info
Diffstat (limited to 'kern/task.c')
-rw-r--r-- | kern/task.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kern/task.c b/kern/task.c index d7d91c17..c7caeb48 100644 --- a/kern/task.c +++ b/kern/task.c @@ -143,15 +143,22 @@ task_info(struct task *task) printk("task: name: %s, threads:\n", task->name); + /* + * Don't grab any lock when accessing threads, so that the function + * can be used to debug in the middle of most critical sections. + * Threads are only destroyed after being removed from their task + * so holding the task lock is enough to guarantee existence. + */ list_for_each_entry(&task->threads, thread, task_node) { - printk("task: " TASK_INFO_ADDR_FMT " %c %8s:" TASK_INFO_ADDR_FMT - " %.2s:%02hu %s\n", + printk(TASK_INFO_ADDR_FMT " %c %8s:" TASK_INFO_ADDR_FMT + " %.2s:%02hu %02u %s\n", (unsigned long)thread, thread_state_to_chr(thread), thread_wchan_desc(thread), (unsigned long)thread_wchan_addr(thread), thread_sched_class_to_str(thread_user_sched_class(thread)), thread_user_priority(thread), + thread_real_global_priority(thread), thread->name); } |