mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Xie <xiehuan09@gmail.com>
To: jan.kiszka@siemens.com, kbingham@kernel.org
Cc: linux-kernel@vger.kernel.org, Jeff Xie <xiehuan09@gmail.com>
Subject: [PATCH] scripts/gdb: fix 'lx-current' for x86
Date: Sat,  4 Feb 2023 17:01:39 +0800	[thread overview]
Message-ID: <20230204090139.1789264-1-xiehuan09@gmail.com> (raw)

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("&current_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


             reply	other threads:[~2023-02-04  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04  9:01 Jeff Xie [this message]
2023-02-07 15:48 ` Jeff Xie
2023-02-07 16:32   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230204090139.1789264-1-xiehuan09@gmail.com \
    --to=xiehuan09@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®