mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] sched/debug: Update print_task formatin  /sys/kernel/debug/sched/debug
@ 2023-12-16 15:44 Junwen Wu
  2023-12-17  2:36 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Junwen Wu @ 2023-12-16 15:44 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, bsegall, vschneid
  Cc: mgorman, bristot, linux-kernel, Junwen Wu

For the sched_debug interface, print_task function  has  output
sum_exec_runtime twice, and the promt message not align with
the output, so optimize the output.

Signed-off-by: Junwen Wu <wudaemon@163.com>
---
 kernel/sched/debug.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 4580a450700e..459109c12d68 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -579,13 +579,12 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 	else
 		SEQ_printf(m, " %c", task_state_to_char(p));
 
-	SEQ_printf(m, "%15s %5d %9Ld.%06ld %c %9Ld.%06ld %9Ld.%06ld %9Ld.%06ld %9Ld %5d ",
+	SEQ_printf(m, "%15s %5d %9Ld.%06ld %c %9Ld.%06ld %9Ld.%06ld %9Ld %5d ",
 		p->comm, task_pid_nr(p),
 		SPLIT_NS(p->se.vruntime),
 		entity_eligible(cfs_rq_of(&p->se), &p->se) ? 'E' : 'N',
 		SPLIT_NS(p->se.deadline),
 		SPLIT_NS(p->se.slice),
-		SPLIT_NS(p->se.sum_exec_runtime),
 		(long long)(p->nvcsw + p->nivcsw),
 		p->prio);
 
@@ -596,10 +595,10 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 		SPLIT_NS(schedstat_val_or_zero(p->stats.sum_block_runtime)));
 
 #ifdef CONFIG_NUMA_BALANCING
-	SEQ_printf(m, " %d %d", task_node(p), task_numa_group_id(p));
+	SEQ_printf(m, "   %d   %d", task_node(p), task_numa_group_id(p));
 #endif
 #ifdef CONFIG_CGROUP_SCHED
-	SEQ_printf_task_group_path(m, task_group(p), " %s")
+	SEQ_printf_task_group_path(m, task_group(p), "   %s")
 #endif
 
 	SEQ_printf(m, "\n");
@@ -611,11 +610,18 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
 
 	SEQ_printf(m, "\n");
 	SEQ_printf(m, "runnable tasks:\n");
-	SEQ_printf(m, " S            task   PID         tree-key  switches  prio"
-		   "     wait-time             sum-exec        sum-sleep\n");
-	SEQ_printf(m, "-------------------------------------------------------"
-		   "------------------------------------------------------\n");
-
+	SEQ_printf(m, " S            task   PID         tree-key          deadline"
+		"            slice  switches   prio"
+		"       wait-time         sum-exec        sum-sleep        sum-block"
+#ifdef CONFIG_NUMA_BALANCING
+		"  node_id"
+#endif
+#ifdef CONFIG_CGROUP_SCHED
+		"  group\n");
+#endif
+	SEQ_printf(m, "-----------------------------------------------------------------"
+			"--------------------------------------------------------------------"
+			"------------------------------------------\n");
 	rcu_read_lock();
 	for_each_process_thread(g, p) {
 		if (task_cpu(p) != rq_cpu)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-17  6:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16 15:44 [PATCH v1] sched/debug: Update print_task formatin /sys/kernel/debug/sched/debug Junwen Wu
2023-12-17  2:36 ` kernel test robot
2023-12-17  4:02 ` kernel test robot
2023-12-17  6:10 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®