* [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error
[not found] <20231129065142.13375-1-Kuan-Ying.Lee@mediatek.com>
@ 2023-11-29 6:51 ` Kuan-Ying Lee
2023-11-29 8:10 ` Oleg Nesterov
2023-11-29 22:33 ` Florian Fainelli
0 siblings, 2 replies; 4+ messages in thread
From: Kuan-Ying Lee @ 2023-11-29 6:51 UTC (permalink / raw)
To: Jan Kiszka, Kieran Bingham, Matthias Brugger,
AngeloGioacchino Del Regno, Andrew Morton, Oleg Nesterov
Cc: casper.li, chinwen.chang, qun-wei.lin, linux-mm, Kuan-Ying Lee,
stable, linux-kernel, linux-arm-kernel, linux-mediatek
Since commit 8e1f385104ac ("kill task_struct->thread_group") remove
the thread_group, we will encounter below issue.
(gdb) lx-ps
TASK PID COMM
0xffff800086503340 0 swapper/0
Python Exception <class 'gdb.error'>: There is no member named thread_group.
Error occurred in Python: There is no member named thread_group.
We use signal->thread_head to iterate all threads instead.
Fixes: 8e1f385104ac ("kill task_struct->thread_group")
Cc: stable@vger.kernel.org
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
---
scripts/gdb/linux/tasks.py | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
index 17ec19e9b5bf..aa5ab6251f76 100644
--- a/scripts/gdb/linux/tasks.py
+++ b/scripts/gdb/linux/tasks.py
@@ -13,7 +13,7 @@
import gdb
-from linux import utils
+from linux import utils, lists
task_type = utils.CachedType("struct task_struct")
@@ -22,19 +22,15 @@ task_type = utils.CachedType("struct task_struct")
def task_lists():
task_ptr_type = task_type.get_type().pointer()
init_task = gdb.parse_and_eval("init_task").address
- t = g = init_task
+ t = init_task
while True:
- while True:
- yield t
+ 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['thread_group']['next'],
- task_ptr_type, "thread_group")
- if t == g:
- break
-
- t = g = utils.container_of(g['tasks']['next'],
- task_ptr_type, "tasks")
+ t = utils.container_of(t['tasks']['next'],
+ task_ptr_type, "tasks")
if t == init_task:
return
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error
2023-11-29 6:51 ` [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error Kuan-Ying Lee
@ 2023-11-29 8:10 ` Oleg Nesterov
2023-11-29 22:15 ` Andrew Morton
2023-11-29 22:33 ` Florian Fainelli
1 sibling, 1 reply; 4+ messages in thread
From: Oleg Nesterov @ 2023-11-29 8:10 UTC (permalink / raw)
To: Kuan-Ying Lee
Cc: Jan Kiszka, Kieran Bingham, Matthias Brugger,
AngeloGioacchino Del Regno, Andrew Morton, casper.li,
chinwen.chang, qun-wei.lin, linux-mm, stable, linux-kernel,
linux-arm-kernel, linux-mediatek
On 11/29, Kuan-Ying Lee wrote:
>
> Since commit 8e1f385104ac ("kill task_struct->thread_group") remove
> the thread_group, we will encounter below issue.
>
> (gdb) lx-ps
> TASK PID COMM
> 0xffff800086503340 0 swapper/0
> Python Exception <class 'gdb.error'>: There is no member named thread_group.
> Error occurred in Python: There is no member named thread_group.
>
> We use signal->thread_head to iterate all threads instead.
Thanks again,
Acked-by: Oleg Nesterov <oleg@redhat.com>
> Fixes: 8e1f385104ac ("kill task_struct->thread_group")
> Cc: stable@vger.kernel.org
Is it possible to merge this simple change before v6.7 ?
Then "cc: stable" can be removed.
Oleg.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error
2023-11-29 8:10 ` Oleg Nesterov
@ 2023-11-29 22:15 ` Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2023-11-29 22:15 UTC (permalink / raw)
To: Oleg Nesterov
Cc: Kuan-Ying Lee, Jan Kiszka, Kieran Bingham, Matthias Brugger,
AngeloGioacchino Del Regno, casper.li, chinwen.chang, qun-wei.lin,
linux-mm, stable, linux-kernel, linux-arm-kernel, linux-mediatek
On Wed, 29 Nov 2023 09:10:09 +0100 Oleg Nesterov <oleg@redhat.com> wrote:
> > Fixes: 8e1f385104ac ("kill task_struct->thread_group")
> > Cc: stable@vger.kernel.org
>
> Is it possible to merge this simple change before v6.7 ?
> Then "cc: stable" can be removed.
Yes, I shall do all that.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error
2023-11-29 6:51 ` [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error Kuan-Ying Lee
2023-11-29 8:10 ` Oleg Nesterov
@ 2023-11-29 22:33 ` Florian Fainelli
1 sibling, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2023-11-29 22:33 UTC (permalink / raw)
To: Kuan-Ying Lee, Jan Kiszka, Kieran Bingham, Matthias Brugger,
AngeloGioacchino Del Regno, Andrew Morton, Oleg Nesterov
Cc: casper.li, chinwen.chang, qun-wei.lin, linux-mm, stable,
linux-kernel, linux-arm-kernel, linux-mediatek
On 11/28/23 22:51, Kuan-Ying Lee wrote:
> Since commit 8e1f385104ac ("kill task_struct->thread_group") remove
> the thread_group, we will encounter below issue.
>
> (gdb) lx-ps
> TASK PID COMM
> 0xffff800086503340 0 swapper/0
> Python Exception <class 'gdb.error'>: There is no member named thread_group.
> Error occurred in Python: There is no member named thread_group.
>
> We use signal->thread_head to iterate all threads instead.
>
> Fixes: 8e1f385104ac ("kill task_struct->thread_group")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-29 22:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231129065142.13375-1-Kuan-Ying.Lee@mediatek.com>
2023-11-29 6:51 ` [PATCH v2 1/3] scripts/gdb/tasks: Fix lx-ps command error Kuan-Ying Lee
2023-11-29 8:10 ` Oleg Nesterov
2023-11-29 22:15 ` Andrew Morton
2023-11-29 22:33 ` Florian Fainelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox