[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1625845315-21587-1-git-send-email-zhouchuangao@vivo.com>
Date: Fri, 9 Jul 2021 08:41:55 -0700
From: zhouchuangao <zhouchuangao@...o.com>
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
linux-kernel@...r.kernel.org
Cc: zhouchuangao <zhouchuangao@...o.com>
Subject: [PATCH v3] kernel/sched/core: Print the time when the process entered the D state
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@...o.com>
---
kernel/sched/core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index cf16f8f..b0e6198 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8154,10 +8154,16 @@ void sched_show_task(struct task_struct *p)
if (pid_alive(p))
ppid = task_pid_nr(rcu_dereference(p->real_parent));
rcu_read_unlock();
+#ifdef CONFIG_SCHED_INFO
+ pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx last-run:%llu\n",
+ free, task_pid_nr(p), ppid,
+ (unsigned long)task_thread_info(p)->flags,
+ p->sched_info.last_arrival);
+#else
pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx\n",
free, task_pid_nr(p), ppid,
(unsigned long)task_thread_info(p)->flags);
-
+#endif
print_worker_info(KERN_INFO, p);
print_stop_info(KERN_INFO, p);
show_stack(p, NULL, KERN_INFO);
--
2.7.4
Powered by blists - more mailing lists