[lkml]   [2022]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip: sched/core] sched/debug: Print each field value left-aligned in sched_show_task()
The following commit has been merged into the sched/core branch of tip:

Commit-ID: 0f03d6805bfc454279169a1460abb3f6b3db317f
Author: Zhen Lei <>
AuthorDate: Wed, 27 Jul 2022 14:08:19 +08:00
Committer: Ingo Molnar <>
CommitterDate: Tue, 02 Aug 2022 21:45:35 +02:00

sched/debug: Print each field value left-aligned in sched_show_task()

Currently, the values of some fields are printed right-aligned, causing
the field value to be next to the next field name rather than next to its
own field name. So print each field value left-aligned, to make it more

stack: 0 pid: 307 ppid: 2 flags:0x00000008
stack:0 pid:308 ppid:2 flags:0x0000000a

This also makes them print in the same style as the other two fields:

task:demo0 state:R running task

Signed-off-by: Zhen Lei <>
Signed-off-by: Ingo Molnar <>
Reviewed-by: Valentin Schneider <>
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5555e49..6785e3b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8825,7 +8825,7 @@ void sched_show_task(struct task_struct *p)
if (pid_alive(p))
ppid = task_pid_nr(rcu_dereference(p->real_parent));
- pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx\n",
+ pr_cont(" stack:%-5lu pid:%-5d ppid:%-6d flags:0x%08lx\n",
free, task_pid_nr(p), ppid,

 \ /
  Last update: 2022-08-02 21:51    [W:0.071 / U:1.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site