From: Ritesh Harjani <riteshh@linux.ibm.com>
To: Jan Kiszka <jan.kiszka@siemens.com>,
Kieran Bingham <kbingham@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] proc: Add struct mount & struct super_block addr in lx-mounts command
Date: Tue, 18 Aug 2020 12:57:57 +0530 [thread overview]
Message-ID: <20200818072758.88EF9A4062@b06wcsmtp001.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <3babefe6-8784-dd9a-75ca-bb6ecff3106c@siemens.com>
On 8/18/20 11:07 AM, Jan Kiszka wrote:
> On 18.08.20 06:04, Ritesh Harjani wrote:
>> This is many times found useful while debugging some FS related issue.
>>
>> <e.g. output>
>> mount super_block fstype devname pathname options
>> 0xffff888a0bfa4b40 0xffff888a0bfc1000 rootfs none / rw 0 0
>> 0xffff888a02c065c0 0xffff8889fcf65000 ext4 /dev/root / rw ,relatime 0 0
>> 0xffff8889fc8cc040 0xffff888a0bb51000 devtmpfs devtmpfs /dev rw ,relatime 0 0
>>
>> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
>> ---
>> scripts/gdb/linux/proc.py | 15 +++++++--------
>> 1 file changed, 7 insertions(+), 8 deletions(-)
>>
>> diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py
>> index 6a56bba233a9..c16fab981bdd 100644
>> --- a/scripts/gdb/linux/proc.py
>> +++ b/scripts/gdb/linux/proc.py
>> @@ -167,6 +167,9 @@ values of that process namespace"""
>> if not namespace:
>> raise gdb.GdbError("No namespace for current process")
>>
>> + gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format(
>> + "mount", "super_block", "fstype", "devname", "pathname"))
>> +
>> for vfs in lists.list_for_each_entry(namespace['list'],
>> mount_ptr_type, "mnt_list"):
>> devname = vfs['mnt_devname'].string()
>> @@ -190,14 +193,10 @@ values of that process namespace"""
>> m_flags = int(vfs['mnt']['mnt_flags'])
>> rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw"
>>
>> - gdb.write(
>> - "{} {} {} {}{}{} 0 0\n"
>> - .format(devname,
>> - pathname,
>> - fstype,
>> - rd,
>> - info_opts(FS_INFO, s_flags),
>> - info_opts(MNT_INFO, m_flags)))
>> + gdb.write("{} {} {} {} {} {} {} {} 0 0\n".format(
>> + vfs.format_string(), superblock.format_string(), fstype,
>> + devname, pathname, rd, info_opts(FS_INFO, s_flags),
>> + info_opts(MNT_INFO, m_flags)))
>
> The last three format elements should not be space-separated. The effect
> can even be seen in your example above.
yes, agreed. Will fix it in next version.
-ritesh
next prev parent reply other threads:[~2020-08-18 7:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 4:04 [PATCH 0/2] scripts:gdb: Add few structs in gdb scripts Ritesh Harjani
2020-08-18 4:04 ` [PATCH 1/2] proc: Add struct mount & struct super_block addr in lx-mounts command Ritesh Harjani
2020-08-18 5:37 ` Jan Kiszka
2020-08-18 7:27 ` Ritesh Harjani [this message]
2020-08-18 4:04 ` [PATCH 2/2] tasks: Add task_struct addr for lx-ps cmd Ritesh Harjani
2020-08-18 5:40 ` Jan Kiszka
2020-08-18 8:55 ` Ritesh Harjani
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=20200818072758.88EF9A4062@b06wcsmtp001.portsmouth.uk.ibm.com \
--to=riteshh@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).