Illia Ostapyshyn
e6d3e653b0
scripts: gdb: vfs: support external dentry names
...
d_shortname of struct dentry only reserves D_NAME_INLINE_LEN characters
and contains garbage for longer names. Use d_name instead, which always
references the valid name.
Link: https://lore.kernel.org/all/[email protected] /
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 79300ac805 ("scripts/gdb: fix dentry_name() lookup")
Signed-off-by: Illia Ostapyshyn <[email protected] >
Tested-by: Florian Fainelli <[email protected] >
Reviewed-by: Florian Fainelli <[email protected] >
Cc: Al Viro <[email protected] >
Cc: Christian Brauner <[email protected] >
Cc: Jan Kara <[email protected] >
Cc: Jan Kiszka <[email protected] >
Cc: Kieran Bingham <[email protected] >
Cc: <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2025-07-09 21:07:54 -07:00
Florian Fainelli
79300ac805
scripts/gdb: fix dentry_name() lookup
...
The "d_iname" member was replaced with "d_shortname.string" in the commit
referenced in the Fixes tag. This prevented the GDB script "lx-mount"
command to properly function:
(gdb) lx-mounts
mount super_block devname pathname fstype options
0xff11000002d21180 0xff11000002d24800 rootfs / rootfs rw 0 0
0xff11000002e18a80 0xff11000003713000 /dev/root / ext4 rw,relatime 0 0
Python Exception <class 'gdb.error'>: There is no member named d_iname.
Error occurred in Python: There is no member named d_iname.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 58cf9c383c ("dcache: back inline names with a struct-wrapped array of unsigned long")
Signed-off-by: Florian Fainelli <[email protected] >
Cc: Al Viro <[email protected] >
Cc: Jan Kara <[email protected] >
Cc: Jan Kiszka <[email protected] >
Cc: Jeff Layton <[email protected] >
Cc: Kieran Bingham <[email protected] >
Cc: <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2025-06-25 15:55:03 -07:00
Glenn Washburn
5a10562bde
scripts/gdb: add GDB convenience functions $lx_dentry_name() and $lx_i_dentry()
...
$lx_dentry_name() generates a full VFS path from a given dentry pointer,
and $lx_i_dentry() returns the dentry pointer associated with the given
inode pointer, if there is one.
Link: https://lkml.kernel.org/r/c9a5ad8efbfbd2cc6559e082734eed7628f43a16.1677631565.git.development@efficientek.com
Signed-off-by: Glenn Washburn <[email protected] >
Cc: Alexander Viro <[email protected] >
Cc: Antonio Borneo <[email protected] >
Cc: Jan Kiszka <[email protected] >
Cc: John Ogness <[email protected] >
Cc: Kieran Bingham <[email protected] >
Cc: Petr Mladek <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2023-04-18 16:39:35 -07:00
Glenn Washburn
f4efbdaf59
scripts/gdb: create linux/vfs.py for VFS related GDB helpers
...
Patch series "GDB VFS utils".
I've created a couple GDB convenience functions that I found useful when
debugging some VFS issues and figure others might find them useful. For
instance, they are useful in setting conditional breakpoints on VFS
functions where you only care if the dentry path is a certain value. I
took the opportunity to create a new "vfs" python module to give VFS
related utilities a home.
This patch (of 2):
This will allow for more VFS specific GDB helpers to be collected in one
place. Move utils.dentry_name into the vfs modules. Also a local
variable in proc.py was changed from vfs to mnt to prevent a naming
collision with the new vfs module.
[[email protected] : add SPDX-License-Identifier]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/7bba4c065a8c2c47f1fc5b03a7278005b04db251.1677631565.git.development@efficientek.com
Signed-off-by: Glenn Washburn <[email protected] >
Cc: Alexander Viro <[email protected] >
Cc: Antonio Borneo <[email protected] >
Cc: Jan Kiszka <[email protected] >
Cc: John Ogness <[email protected] >
Cc: Kieran Bingham <[email protected] >
Cc: Petr Mladek <[email protected] >
Signed-off-by: Andrew Morton <[email protected] >
2023-04-18 16:39:34 -07:00