Skip to contentSkip to conversation

sched/debug: print column titles of show_state_filter()

PATCH In review Shirish S 2 participants 2 messages Jul 13, 2021 Scheduler

lore
Share & tools
lore

Shirish S

author
#0 lore raw

PATCH 1/1 sched/debug: print column titles of show_state_filter()

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.

---
 kernel/sched/core.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/sched/core.c +5 -0
index 2d9ff40f4661..d95d46a89e7e 100644
@@ -8194,6 +8194,11 @@ void show_state_filter(unsigned int state_filter)
 {
 	struct task_struct *g, *p;
 
+#if BITS_PER_LONG == 32
+	pr_info("  task                PC stack   pid father\n");
+#else
+	pr_info("  task                        PC stack   pid father\n");
+#endif
 	rcu_read_lock();
 	for_each_process_thread(g, p) {
 		/*
Signature · 1 line
2.17.1
#1 lore raw
Quoted 14 lines · On Tue, 13 Jul 2021 16:35:18 +0530 Shirish S <[email protected]> wrote:

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.

---
 kernel/sched/core.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/sched/core.c +0 -0
index 2d9ff40f4661..d95d46a89e7e 100644

kernel/sched/core.c void show_state_filter(unsigned int state_filter) · line 8201

Quoted 8 lines
kernel/sched/core.c +5 -0
@@ -8194,6 +8194,11 @@ void show_state_filter(unsigned int state_filter)
 {
 	struct task_struct *g, *p;
 
+#if BITS_PER_LONG == 32
+	pr_info("  task                PC stack   pid father\n");
+#else
+	pr_info("  task                        PC stack   pid father\n");
+#endif

Or remove the ugly #ifdef logic and just have:

	pr_info("  task%*s", BITS_PER_LONG == 32 ? 38 : 46,
		"PC stack   pid father\n");

-- Steve

Quoted 3 lines
kernel/sched/core.c +0 -0
 	rcu_read_lock();
 	for_each_process_thread(g, p) {
 		/*