From: Junwen Wu <wudaemon@163.com>
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, bsegall@google.com,
vschneid@redhat.com
Cc: mgorman@suse.de, bristot@redhat.com,
linux-kernel@vger.kernel.org, Junwen Wu <wudaemon@163.com>
Subject: [PATCH v1] sched/debug: Update print_task formatin /sys/kernel/debug/sched/debug
Date: Sat, 16 Dec 2023 15:44:12 +0000 [thread overview]
Message-ID: <20231216154412.613443-1-wudaemon@163.com> (raw)
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
next reply other threads:[~2023-12-16 15:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-16 15:44 Junwen Wu [this message]
2023-12-17 2:36 ` kernel test robot
2023-12-17 4:02 ` kernel test robot
2023-12-17 6:10 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231216154412.613443-1-wudaemon@163.com \
--to=wudaemon@163.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®