Commit 998ec76b authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Linus Torvalds

scripts/gdb/proc: add struct mount & struct super_block addr in lx-mounts command

This is many times found useful while debugging some FS related
issue.

<e.g. output>
      mount          super_block     devname pathname fstype options
0xffff888a0bfa4b40 0xffff888a0bfc1000 none / rootfs rw 0 0
0xffff888a033f75c0 0xffff8889fcf65000 /dev/root / ext4 rw,relatime 0 0
0xffff8889fc8ce040 0xffff888a0bb51000 devtmpfs /dev devtmpfs rw,relatime 0 0
Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Link: http://lkml.kernel.org/r/a3c4177e1597b3e06d66d55e07d72c0c46a03571.1597742951.git.riteshh@linux.ibm.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ac05b7a1
...@@ -167,6 +167,9 @@ values of that process namespace""" ...@@ -167,6 +167,9 @@ values of that process namespace"""
if not namespace: if not namespace:
raise gdb.GdbError("No namespace for current process") raise gdb.GdbError("No namespace for current process")
gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format(
"mount", "super_block", "devname", "pathname", "fstype"))
for vfs in lists.list_for_each_entry(namespace['list'], for vfs in lists.list_for_each_entry(namespace['list'],
mount_ptr_type, "mnt_list"): mount_ptr_type, "mnt_list"):
devname = vfs['mnt_devname'].string() devname = vfs['mnt_devname'].string()
...@@ -190,14 +193,10 @@ values of that process namespace""" ...@@ -190,14 +193,10 @@ values of that process namespace"""
m_flags = int(vfs['mnt']['mnt_flags']) m_flags = int(vfs['mnt']['mnt_flags'])
rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw" rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw"
gdb.write( gdb.write("{} {} {} {} {} {}{}{} 0 0\n".format(
"{} {} {} {}{}{} 0 0\n" vfs.format_string(), superblock.format_string(), devname,
.format(devname, pathname, fstype, rd, info_opts(FS_INFO, s_flags),
pathname, info_opts(MNT_INFO, m_flags)))
fstype,
rd,
info_opts(FS_INFO, s_flags),
info_opts(MNT_INFO, m_flags)))
LxMounts() LxMounts()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment