]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scripts/gdb: fix 'lx-lsmod' show the wrong size
authorKuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Mon, 10 Jul 2023 09:28:46 +0000 (17:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:05 +0000 (09:48 +0200)
commitb49c9a2d85ebf8bea38c333eb1a0f6a7114a9993
treecb7f889bb301e65993841d29d80f3a6056dd1787
parent84f40e85bdc16106b7059901c8b223a98dbc3626
scripts/gdb: fix 'lx-lsmod' show the wrong size

[ Upstream commit fb40b0537342e1acd5c2daf2ff6780c1d0d2883c ]

'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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/gdb/linux/constants.py.in
scripts/gdb/linux/modules.py