From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, qun-wei.lin@mediatek.com,
p.raghav@samsung.com, mcgrof@kernel.org, matthias.bgg@gmail.com,
kbingham@kernel.org, jan.kiszka@siemens.com,
chinwen.chang@mediatek.com,
angelogioacchino.delregno@collabora.com,
Kuan-Ying.Lee@mediatek.com, akpm@linux-foundation.org
Subject: + scripts-gdb-fix-lx-lsmod-show-the-wrong-size.patch added to mm-nonmm-unstable branch
Date: Tue, 01 Aug 2023 12:39:04 -0700 [thread overview]
Message-ID: <20230801193905.21DFFC433C8@smtp.kernel.org> (raw)
The patch titled
Subject: scripts/gdb: fix 'lx-lsmod' show the wrong size
has been added to the -mm mm-nonmm-unstable branch. Its filename is
scripts-gdb-fix-lx-lsmod-show-the-wrong-size.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/scripts-gdb-fix-lx-lsmod-show-the-wrong-size.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Subject: scripts/gdb: fix 'lx-lsmod' show the wrong size
Date: Mon, 10 Jul 2023 17:28:46 +0800
'lsmod' shows total core layout size, so we need to sum up all the
sections in core layout in gdb scripts.
/ # lsmod
kasan_test 200704 0 - Live 0xffff80007f640000
Before patch:
(gdb) lx-lsmod
Address Module Size Used by
0xffff80007f640000 kasan_test 36864 0
After patch:
(gdb) lx-lsmod
Address Module Size Used by
0xffff80007f640000 kasan_test 200704 0
Link: https://lkml.kernel.org/r/20230710092852.31049-1-Kuan-Ying.Lee@mediatek.com
Fixes: b4aff7513df3 ("scripts/gdb: use mem instead of core_layout to get the module address")
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Qun-Wei Lin <qun-wei.lin@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
scripts/gdb/linux/constants.py.in | 3 +++
scripts/gdb/linux/modules.py | 12 +++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
--- a/scripts/gdb/linux/constants.py.in~scripts-gdb-fix-lx-lsmod-show-the-wrong-size
+++ a/scripts/gdb/linux/constants.py.in
@@ -64,6 +64,9 @@ LX_GDBPARSED(IRQ_HIDDEN)
/* linux/module.h */
LX_GDBPARSED(MOD_TEXT)
+LX_GDBPARSED(MOD_DATA)
+LX_GDBPARSED(MOD_RODATA)
+LX_GDBPARSED(MOD_RO_AFTER_INIT)
/* linux/mount.h */
LX_VALUE(MNT_NOSUID)
--- a/scripts/gdb/linux/modules.py~scripts-gdb-fix-lx-lsmod-show-the-wrong-size
+++ a/scripts/gdb/linux/modules.py
@@ -73,11 +73,17 @@ class LxLsmod(gdb.Command):
" " if utils.get_long_type().sizeof == 8 else ""))
for module in module_list():
- layout = module['mem'][constants.LX_MOD_TEXT]
+ text = module['mem'][constants.LX_MOD_TEXT]
+ text_addr = str(text['base']).split()[0]
+ total_size = 0
+
+ for i in range(constants.LX_MOD_TEXT, constants.LX_MOD_RO_AFTER_INIT + 1):
+ total_size += module['mem'][i]['size']
+
gdb.write("{address} {name:<19} {size:>8} {ref}".format(
- address=str(layout['base']).split()[0],
+ address=text_addr,
name=module['name'].string(),
- size=str(layout['size']),
+ size=str(total_size),
ref=str(module['refcnt']['counter'] - 1)))
t = self._module_use_type.get_type().pointer()
_
Patches currently in -mm which might be from Kuan-Ying.Lee@mediatek.com are
scripts-gdb-fix-lx-lsmod-show-the-wrong-size.patch
reply other threads:[~2023-08-01 19:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230801193905.21DFFC433C8@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=Kuan-Ying.Lee@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chinwen.chang@mediatek.com \
--cc=jan.kiszka@siemens.com \
--cc=kbingham@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mcgrof@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=p.raghav@samsung.com \
--cc=qun-wei.lin@mediatek.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.