lkml.org 
[lkml]   [2021]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched/debug: print column titles of show_state_filter()
Date
This addition in the debug output shall improve readablitly..
Its not intuitive for users that the pid printed in last column
is of parent process.

Without this patch:
localhost ~ # dmesg -w &
localhost ~ # echo w > /proc/sysrq-trigger
[22148.730225] sysrq: Show Blocked State
localhost ~ #

With this patch:
localhost ~ # dmesg -w &
localhost ~ # echo w > /proc/sysrq-trigger
[ 99.979365] sysrq: Show Blocked State
--> [ 99.983471] task PC stack pid father
localhost ~ #

v2: Dropped #ifdef logic
v3: Sample output in commit message

Signed-off-by: Shirish S <shirish.s@amd.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/sched/core.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 20ffcc044134..d9c7014870d5 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8174,6 +8174,9 @@ void show_state_filter(unsigned int state_filter)
{
struct task_struct *g, *p;

+ pr_info(" task%*s", BITS_PER_LONG == 32 ? 38 : 46,
+ "PC stack ppid\n");
+
rcu_read_lock();
for_each_process_thread(g, p) {
/*
--
2.17.1
\
 
 \ /
  Last update: 2021-08-12 16:10    [W:2.270 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site