lkml.org 
[lkml]   [2021]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kernel/sched/core: Print the time when the process entered the D state
Date
Sometimes we need to trigger /proc/sysrq-trigger to view the information
of the D state process in the system.
e.g:
echo w > /proc/sysrq-trigger

Here we print the scheduling time of the process, which is convenient
for us to judge the state of the system and for debugging.

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
---
kernel/sched/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index cf16f8f..e03474d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8154,9 +8154,10 @@ void sched_show_task(struct task_struct *p)
if (pid_alive(p))
ppid = task_pid_nr(rcu_dereference(p->real_parent));
rcu_read_unlock();
- pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx\n",
+ pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx sched:%llu\n",
free, task_pid_nr(p), ppid,
- (unsigned long)task_thread_info(p)->flags);
+ (unsigned long)task_thread_info(p)->flags,
+ p->sched_info.last_arrival);

print_worker_info(KERN_INFO, p);
print_stop_info(KERN_INFO, p);
--
2.7.4
\
 
 \ /
  Last update: 2021-07-09 07:07    [W:0.054 / U:1.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site