From: Kuan-Ying Lee <kuan-ying.lee@canonical.com>
To: kuan-ying.lee@canonical.com,
Andrew Morton <akpm@linux-foundation.org>,
Jan Kiszka <jan.kiszka@siemens.com>,
Kieran Bingham <kbingham@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Ian Kent <raven@themaw.net>, Miklos Szeredi <mszeredi@redhat.com>
Cc: linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 3/5] scripts/gdb: fix lx-mounts command error
Date: Tue, 23 Jul 2024 14:48:59 +0800 [thread overview]
Message-ID: <20240723064902.124154-4-kuan-ying.lee@canonical.com> (raw)
In-Reply-To: <20240723064902.124154-1-kuan-ying.lee@canonical.com>
(gdb) lx-mounts
mount super_block devname pathname fstype options
Python Exception <class 'gdb.error'>: There is no member named list.
Error occurred in Python: There is no member named list.
We encoutner the above issue after commit 2eea9ce4310d ("mounts: keep
list of mounts in an rbtree"). The commit move a mount from list into
rbtree.
So we can instead use rbtree to iterate all mounts information.
Fixes: 2eea9ce4310d ("mounts: keep list of mounts in an rbtree")
Cc: <stable@vger.kernel.org>
Signed-off-by: Kuan-Ying Lee <kuan-ying.lee@canonical.com>
---
scripts/gdb/linux/proc.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py
index 43c687e7a69d..65dd1bd12964 100644
--- a/scripts/gdb/linux/proc.py
+++ b/scripts/gdb/linux/proc.py
@@ -18,6 +18,7 @@ from linux import utils
from linux import tasks
from linux import lists
from linux import vfs
+from linux import rbtree
from struct import *
@@ -172,8 +173,7 @@ values of that process namespace"""
gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format(
"mount", "super_block", "devname", "pathname", "fstype"))
- for mnt in lists.list_for_each_entry(namespace['list'],
- mount_ptr_type, "mnt_list"):
+ for mnt in rbtree.rb_inorder_for_each_entry(namespace['mounts'], mount_ptr_type, "mnt_node"):
devname = mnt['mnt_devname'].string()
devname = devname if devname else "none"
--
2.34.1
next prev parent reply other threads:[~2024-07-23 6:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 6:48 [PATCH v3 0/5] Fix some GDB command error and add some GDB commands Kuan-Ying Lee
2024-07-23 6:48 ` [PATCH v3 1/5] scripts/gdb: fix timerlist parsing issue Kuan-Ying Lee
2024-07-23 6:48 ` [PATCH v3 2/5] scripts/gdb: add iteration function for rbtree Kuan-Ying Lee
2024-07-23 6:48 ` Kuan-Ying Lee [this message]
2024-07-23 6:49 ` [PATCH v3 4/5] scripts/gdb: Add 'lx-stack_depot_lookup' command Kuan-Ying Lee
2024-07-23 6:49 ` [PATCH v3 5/5] scripts/gdb: Add 'lx-kasan_mem_to_shadow' command Kuan-Ying Lee
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=20240723064902.124154-4-kuan-ying.lee@canonical.com \
--to=kuan-ying.lee@canonical.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=jan.kiszka@siemens.com \
--cc=kbingham@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mszeredi@redhat.com \
--cc=raven@themaw.net \
--cc=stable@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