[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <783d1e6d26c16fd846bb600d00c99a3ca074ccc6.camel@mediatek.com>
Date: Tue, 28 Nov 2023 11:45:20 +0000
From: Kuan-Ying Lee (李冠穎)
<Kuan-Ying.Lee@...iatek.com>
To: "oleg@...hat.com" <oleg@...hat.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Qun-wei Lin (林群崴)
<Qun-wei.Lin@...iatek.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Chinwen Chang (張錦文)
<chinwen.chang@...iatek.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
Casper Li (李中榮) <casper.li@...iatek.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"kbingham@...nel.org" <kbingham@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>,
"jan.kiszka@...mens.com" <jan.kiszka@...mens.com>
Subject: Re: [PATCH 1/3] scripts/gdb/tasks: Fix lx-ps command error
On Mon, 2023-11-27 at 13:03 +0100, Oleg Nesterov wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> On 11/27, Kuan-Ying Lee wrote:
> >
> > @@ -25,13 +25,9 @@ def task_lists():
> > t = g = init_task
> >
> > while True:
> > - while True:
> > - yield t
> > -
> > - t = utils.container_of(t['thread_group']['next'],
> > - task_ptr_type, "thread_group")
> > - if t == g:
> > - break
> > + thread_head = t['signal']['thread_head']
> > + for thread in lists.list_for_each_entry(thread_head,
> task_ptr_type, 'thread_node'):
> > + yield thread
> >
> > t = g = utils.container_of(g['tasks']['next'],
> > task_ptr_type, "tasks")
>
> Thanks!
>
> I do not know python, but it seems that with this patch we can kill g
> or t?
> Can't
>
> def task_lists():
> task_ptr_type = task_type.get_type().pointer()
> init_task = gdb.parse_and_eval("init_task").address
> t = init_task
>
> while True:
> thread_head = t['signal']['thread_head']
> for thread in lists.list_for_each_entry(thread_head, task_ptr_type,
> 'thread_node'):
> yield thread
>
> t = utils.container_of(t['tasks']['next'],
> task_ptr_type, "tasks")
> if t == init_task:
> return
>
> work?
Yes, you are right.
I will fix it in v2.
Thanks,
Kuan-Ying Lee
>
> Oleg.
>
Powered by blists - more mailing lists