* [PATCH] scripts/gdb: fix 'lx-current' for x86
@ 2023-02-04 9:01 Jeff Xie
2023-02-07 15:48 ` Jeff Xie
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Xie @ 2023-02-04 9:01 UTC (permalink / raw)
To: jan.kiszka, kbingham; +Cc: linux-kernel, Jeff Xie
When printing the name of the current process, it will report an error:
(gdb) p $lx_current().comm
Python Exception <class 'gdb.error'> No symbol "current_task" in current context.:
Error occurred in Python: No symbol "current_task" in current context.
Because the commit <e57ef2ed97c1> ("x86: Put hot per CPU variables into a struct")
changed it.
Signed-off-by: Jeff Xie <xiehuan09@gmail.com>
---
scripts/gdb/linux/cpus.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
index 15fc4626d236..9ee99f9fae8d 100644
--- a/scripts/gdb/linux/cpus.py
+++ b/scripts/gdb/linux/cpus.py
@@ -163,7 +163,7 @@ def get_current_task(cpu):
task_ptr_type = task_type.get_type().pointer()
if utils.is_target_arch("x86"):
- var_ptr = gdb.parse_and_eval("¤t_task")
+ var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task")
return per_cpu(var_ptr, cpu).dereference()
elif utils.is_target_arch("aarch64"):
current_task_addr = gdb.parse_and_eval("$SP_EL0")
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts/gdb: fix 'lx-current' for x86
2023-02-04 9:01 [PATCH] scripts/gdb: fix 'lx-current' for x86 Jeff Xie
@ 2023-02-07 15:48 ` Jeff Xie
2023-02-07 16:32 ` Jan Kiszka
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Xie @ 2023-02-07 15:48 UTC (permalink / raw)
To: jan.kiszka, kbingham, Andrew Morton; +Cc: linux-kernel
Andrew was added.
Hi Andrew,
I found the patches for the ./scripts/gdb/* were merged by you before,
but the "./scripts/get_maintainer.pl ./scripts/gdb/linux/cpus.py"
can't find your name, so added you.
Can you review this patch ;-)
On Sat, Feb 4, 2023 at 5:02 PM Jeff Xie <xiehuan09@gmail.com> wrote:
>
> When printing the name of the current process, it will report an error:
> (gdb) p $lx_current().comm
> Python Exception <class 'gdb.error'> No symbol "current_task" in current context.:
> Error occurred in Python: No symbol "current_task" in current context.
>
> Because the commit <e57ef2ed97c1> ("x86: Put hot per CPU variables into a struct")
> changed it.
>
> Signed-off-by: Jeff Xie <xiehuan09@gmail.com>
> ---
> scripts/gdb/linux/cpus.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
> index 15fc4626d236..9ee99f9fae8d 100644
> --- a/scripts/gdb/linux/cpus.py
> +++ b/scripts/gdb/linux/cpus.py
> @@ -163,7 +163,7 @@ def get_current_task(cpu):
> task_ptr_type = task_type.get_type().pointer()
>
> if utils.is_target_arch("x86"):
> - var_ptr = gdb.parse_and_eval("¤t_task")
> + var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task")
> return per_cpu(var_ptr, cpu).dereference()
> elif utils.is_target_arch("aarch64"):
> current_task_addr = gdb.parse_and_eval("$SP_EL0")
> --
> 2.25.1
>
--
Thanks,
JeffXie
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts/gdb: fix 'lx-current' for x86
2023-02-07 15:48 ` Jeff Xie
@ 2023-02-07 16:32 ` Jan Kiszka
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2023-02-07 16:32 UTC (permalink / raw)
To: Jeff Xie, kbingham, Andrew Morton; +Cc: linux-kernel
On 07.02.23 16:48, Jeff Xie wrote:
> Andrew was added.
>
> Hi Andrew,
>
> I found the patches for the ./scripts/gdb/* were merged by you before,
> but the "./scripts/get_maintainer.pl ./scripts/gdb/linux/cpus.py"
> can't find your name, so added you.
>
Yes, Andrew is merging scripts/gdb stuff.
> Can you review this patch ;-)
>
> On Sat, Feb 4, 2023 at 5:02 PM Jeff Xie <xiehuan09@gmail.com> wrote:
>>
>> When printing the name of the current process, it will report an error:
>> (gdb) p $lx_current().comm
>> Python Exception <class 'gdb.error'> No symbol "current_task" in current context.:
>> Error occurred in Python: No symbol "current_task" in current context.
>>
>> Because the commit <e57ef2ed97c1> ("x86: Put hot per CPU variables into a struct")
>> changed it.
>>
>> Signed-off-by: Jeff Xie <xiehuan09@gmail.com>
>> ---
>> scripts/gdb/linux/cpus.py | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
>> index 15fc4626d236..9ee99f9fae8d 100644
>> --- a/scripts/gdb/linux/cpus.py
>> +++ b/scripts/gdb/linux/cpus.py
>> @@ -163,7 +163,7 @@ def get_current_task(cpu):
>> task_ptr_type = task_type.get_type().pointer()
>>
>> if utils.is_target_arch("x86"):
>> - var_ptr = gdb.parse_and_eval("¤t_task")
>> + var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task")
>> return per_cpu(var_ptr, cpu).dereference()
>> elif utils.is_target_arch("aarch64"):
>> current_task_addr = gdb.parse_and_eval("$SP_EL0")
>> --
>> 2.25.1
>>
>
FWIW:
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Should go into 6.2 if possible.
Thanks
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-07 16:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 9:01 [PATCH] scripts/gdb: fix 'lx-current' for x86 Jeff Xie
2023-02-07 15:48 ` Jeff Xie
2023-02-07 16:32 ` Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.