Messages in this thread | | | Date | Thu, 12 Jan 2023 16:40:36 +0800 | From | Chen Yu <> | Subject | Re: [PATCH] sched: print parent comm in sched_show_task() |
| |
Hi, On 2023-01-10 at 17:35:34 +0800, Yuanhan Zhang wrote: > Hi Petr and Chen, > Thanks for your emails! Petr's suggestions sure make a lot of sense. > Please review the following implementation, it would print a new line like: > " parent:kthreadd ppid:2 " > after the origin line. > > --- > > kernel/sched/core.c | 15 ++++++++------- > > 1 file changed, 8 insertions(+), 7 deletions(-) > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index cb2aa2b54c7a..86ee90404ddb 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -8853,7 +8853,7 @@ SYSCALL_DEFINE2(sched_rr_get_interval_time32, pid_t, > pid, > > void sched_show_task(struct task_struct *p) > > { > > unsigned long free = 0; > > - int ppid; > > + struct task_struct *parent; > Above line could be moved inside: if (pid_alive(p)). And the format of this patch seems to be broken, please resend after fixing the issues reported by scripts/checkpatch.pl
thanks, Chenyu
| |