* [PATCH] sched/debug: fix trival print task format
@ 2019-12-12 12:22 Xie XiuQi
2019-12-12 14:37 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Xie XiuQi @ 2019-12-12 12:22 UTC (permalink / raw)
To: peterz, mingo, juri.lelli, vincent.guittot
Cc: dietmar.eggemann, rostedt, bsegall, mgorman, linux-kernel
Ensure levave a whitespace between state and task name.
w/o patch:
runnable tasks:
S task PID tree-key switches prio wait
-----------------------------------------------------------------
I kworker/0:2 656 87693.884557 8255 120
Sirq/10-ACPI:Ged 829 0.000000 3 49
Sirq/11-ACPI:Ged 830 0.000000 3 49
Sirq/50-arm-smmu 945 0.000000 3 49
with patch:
runnable tasks:
S task PID tree-key switches prio wait
------------------------------------------------------------------
I kworker/0:2 656 87693.884557 8255 120
S irq/10-ACPI:Ged 829 0.000000 3 49
S irq/11-ACPI:Ged 830 0.000000 3 49
S irq/50-arm-smmu 945 0.000000 3 49
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
---
kernel/sched/debug.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index f7e4579e746c..a1b5a4c1213e 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -434,9 +434,9 @@ static void
print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
{
if (rq->curr == p)
- SEQ_printf(m, ">R");
+ SEQ_printf(m, ">R ");
else
- SEQ_printf(m, " %c", task_state_to_char(p));
+ SEQ_printf(m, " %c ", task_state_to_char(p));
SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
p->comm, task_pid_nr(p),
@@ -465,10 +465,10 @@ 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"
+ SEQ_printf(m, " S task PID tree-key switches prio"
" wait-time sum-exec sum-sleep\n");
SEQ_printf(m, "-------------------------------------------------------"
- "----------------------------------------------------\n");
+ "------------------------------------------------------\n");
rcu_read_lock();
for_each_process_thread(g, p) {
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sched/debug: fix trival print task format
2019-12-12 12:22 [PATCH] sched/debug: fix trival print task format Xie XiuQi
@ 2019-12-12 14:37 ` Steven Rostedt
2019-12-13 6:03 ` Xie XiuQi
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2019-12-12 14:37 UTC (permalink / raw)
To: Xie XiuQi
Cc: peterz, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
bsegall, mgorman, linux-kernel
On Thu, 12 Dec 2019 20:22:44 +0800
Xie XiuQi <xiexiuqi@huawei.com> wrote:
> Ensure levave a whitespace between state and task name.
"levave"?
>
> w/o patch:
> runnable tasks:
> S task PID tree-key switches prio wait
> -----------------------------------------------------------------
> I kworker/0:2 656 87693.884557 8255 120
> Sirq/10-ACPI:Ged 829 0.000000 3 49
> Sirq/11-ACPI:Ged 830 0.000000 3 49
> Sirq/50-arm-smmu 945 0.000000 3 49
>
> with patch:
> runnable tasks:
> S task PID tree-key switches prio wait
> ------------------------------------------------------------------
> I kworker/0:2 656 87693.884557 8255 120
> S irq/10-ACPI:Ged 829 0.000000 3 49
> S irq/11-ACPI:Ged 830 0.000000 3 49
> S irq/50-arm-smmu 945 0.000000 3 49
>
> Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
> ---
> kernel/sched/debug.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index f7e4579e746c..a1b5a4c1213e 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -434,9 +434,9 @@ static void
> print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
> {
> if (rq->curr == p)
> - SEQ_printf(m, ">R");
> + SEQ_printf(m, ">R ");
> else
> - SEQ_printf(m, " %c", task_state_to_char(p));
> + SEQ_printf(m, " %c ", task_state_to_char(p));
>
> SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
Wouldn't it be simpler to just add one space to the above?
SEQ_printf(m, " %15s %5d %9Ld.%06ld %9Ld %5d ",
?
-- Steve
> p->comm, task_pid_nr(p),
> @@ -465,10 +465,10 @@ 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"
> + SEQ_printf(m, " S task PID tree-key switches prio"
> " wait-time sum-exec sum-sleep\n");
> SEQ_printf(m, "-------------------------------------------------------"
> - "----------------------------------------------------\n");
> + "------------------------------------------------------\n");
>
> rcu_read_lock();
> for_each_process_thread(g, p) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sched/debug: fix trival print task format
2019-12-12 14:37 ` Steven Rostedt
@ 2019-12-13 6:03 ` Xie XiuQi
0 siblings, 0 replies; 3+ messages in thread
From: Xie XiuQi @ 2019-12-13 6:03 UTC (permalink / raw)
To: Steven Rostedt
Cc: peterz, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
bsegall, mgorman, linux-kernel
Hi,
On 2019/12/12 22:37, Steven Rostedt wrote:
> On Thu, 12 Dec 2019 20:22:44 +0800
> Xie XiuQi <xiexiuqi@huawei.com> wrote:
>
>> Ensure levave a whitespace between state and task name.
>
> "levave"?
Sorry for the typo.
>
>>
>> w/o patch:
>> runnable tasks:
>> S task PID tree-key switches prio wait
>> -----------------------------------------------------------------
>> I kworker/0:2 656 87693.884557 8255 120
>> Sirq/10-ACPI:Ged 829 0.000000 3 49
>> Sirq/11-ACPI:Ged 830 0.000000 3 49
>> Sirq/50-arm-smmu 945 0.000000 3 49
>>
>> with patch:
>> runnable tasks:
>> S task PID tree-key switches prio wait
>> ------------------------------------------------------------------
>> I kworker/0:2 656 87693.884557 8255 120
>> S irq/10-ACPI:Ged 829 0.000000 3 49
>> S irq/11-ACPI:Ged 830 0.000000 3 49
>> S irq/50-arm-smmu 945 0.000000 3 49
>>
>> Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
>> ---
>> kernel/sched/debug.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
>> index f7e4579e746c..a1b5a4c1213e 100644
>> --- a/kernel/sched/debug.c
>> +++ b/kernel/sched/debug.c
>> @@ -434,9 +434,9 @@ static void
>> print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
>> {
>> if (rq->curr == p)
>> - SEQ_printf(m, ">R");
>> + SEQ_printf(m, ">R ");
>> else
>> - SEQ_printf(m, " %c", task_state_to_char(p));
>> + SEQ_printf(m, " %c ", task_state_to_char(p));
>>
>> SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
>
> Wouldn't it be simpler to just add one space to the above?
>
> SEQ_printf(m, " %15s %5d %9Ld.%06ld %9Ld %5d ",
>
> ?
That true, thanks.
>
> -- Steve
>
>> p->comm, task_pid_nr(p),
>> @@ -465,10 +465,10 @@ 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"
>> + SEQ_printf(m, " S task PID tree-key switches prio"
>> " wait-time sum-exec sum-sleep\n");
>> SEQ_printf(m, "-------------------------------------------------------"
>> - "----------------------------------------------------\n");
>> + "------------------------------------------------------\n");
>>
>> rcu_read_lock();
>> for_each_process_thread(g, p) {
>
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-13 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 12:22 [PATCH] sched/debug: fix trival print task format Xie XiuQi
2019-12-12 14:37 ` Steven Rostedt
2019-12-13 6:03 ` Xie XiuQi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).