Commit 0f03d680 authored by Zhen Lei's avatar Zhen Lei Committed by Ingo Molnar

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
readable.

 Before:
	stack:    0 pid:  307 ppid:     2 flags:0x00000008
 After:
	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: default avatarZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarValentin Schneider <vschneid@redhat.com>
Link: https://lore.kernel.org/r/20220727060819.1085-1-thunder.leizhen@huawei.com
parent b3f53daa
...@@ -8825,7 +8825,7 @@ void sched_show_task(struct task_struct *p) ...@@ -8825,7 +8825,7 @@ void sched_show_task(struct task_struct *p)
if (pid_alive(p)) if (pid_alive(p))
ppid = task_pid_nr(rcu_dereference(p->real_parent)); ppid = task_pid_nr(rcu_dereference(p->real_parent));
rcu_read_unlock(); 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\n",
free, task_pid_nr(p), ppid, free, task_pid_nr(p), ppid,
read_task_thread_flags(p)); read_task_thread_flags(p));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment