lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20231114225833.1691370-1-ronan@rjp.ie>
Date:   Tue, 14 Nov 2023 15:56:25 -0700
From:   Ronan Pigott <ronan@....ie>
To:     peterz@...radead.org
Cc:     Ronan Pigott <ronan@....ie>, Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        linux-kernel@...r.kernel.org (open list:SCHEDULER)
Subject: [PATCH] sched/debug: re-align header in sched/debug debugfs output

New fields were introduced with EEVDF, so we should adjust the table
header to match. Additionally, the sum_exec_runtime field was
duplicated, so one was removed.

Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy")
Signed-off-by: Ronan Pigott <ronan@....ie>
---
I decided to put each title section on its own line to match printf
invocation above, and to make it a little easier to see the intended
field width. I hope the kernel can suffer a few extra source lines for
this convenience.

 kernel/sched/debug.c | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 4580a450700e..8d9f8f402059 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -579,7 +579,7 @@ 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.%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',
@@ -589,14 +589,13 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 		(long long)(p->nvcsw + p->nivcsw),
 		p->prio);
 
-	SEQ_printf(m, "%9lld.%06ld %9lld.%06ld %9lld.%06ld %9lld.%06ld",
+	SEQ_printf(m, "%9lld.%06ld %9lld.%06ld %9lld.%06ld",
 		SPLIT_NS(schedstat_val_or_zero(p->stats.wait_sum)),
-		SPLIT_NS(p->se.sum_exec_runtime),
 		SPLIT_NS(schedstat_val_or_zero(p->stats.sum_sleep_runtime)),
 		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, " %5d %5d", task_node(p), task_numa_group_id(p));
 #endif
 #ifdef CONFIG_CGROUP_SCHED
 	SEQ_printf_task_group_path(m, task_group(p), " %s")
@@ -611,10 +610,37 @@ 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"
+		" E"
+		"         deadline"
+		"            slice"
+		"         sum-exec"
+		"  switches"
+		"  prio"
+		"        wait-time"
+		"        sum-sleep"
+		"        sum-block"
+#ifdef CONFIG_NUMA_BALANCING
+		"  node    id"
+#endif
+#ifdef CONFIG_CGROUP_SCHED
+		" task-group"
+#endif
+		"\n"
+	);
+	SEQ_printf(m, "--------------------------------------------------------"
+		"--------------------------------------------------------------"
+		"-------------------------------------------"
+#ifdef CONFIG_NUMA_BALANCING
+		"------------"
+#endif
+#ifdef CONFIG_CGROUP_SCHED
+		"-----------"
+#endif
+		"\n");
 
 	rcu_read_lock();
 	for_each_process_thread(g, p) {
-- 
2.42.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ