Hi,Shiyuan
Thank you for the patch.
在 2021年01月19日 17:43, crash-utility-request(a)redhat.com 写道:
Date: Tue, 19 Jan 2021 10:02:17 +0800
From: Yunfeng Ye <yeyunfeng(a)huawei.com>
To: <crash-utility(a)redhat.com>
Cc: Hewenliang <hewenliang4(a)huawei.com>, Shiyuan Hu
<hushiyuan(a)huawei.com>
Subject: [Crash-utility] [PATCH] Show the module's base address for
"mod" command
Message-ID: <f1f1ae61-1526-a7d5-ff07-493a1579ff3d(a)huawei.com>
Content-Type: text/plain; charset="utf-8"
Currently the "mod" command show the address of the module struct,
it is inconvenient to know the address range of the module, so extend
to show the base adddress for "mod" command.
Acked-by: Lianbo Jiang <lijiang(a)redhat.com>
Signed-off-by: Yunfeng Ye <yeyunfeng(a)huawei.com>
---
kernel.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel.c b/kernel.c
index 272e0d8751cf..9391c5b37a15 100644
--- a/kernel.c
+++ b/kernel.c
@@ -4473,6 +4473,7 @@ do_module_cmd(ulong flag, char *modref, ulong address,
char buf1[BUFSIZE];
char buf2[BUFSIZE];
char buf3[BUFSIZE];
+ char buf4[BUFSIZE];
if (NO_MODULES())
return;
@@ -4494,10 +4495,12 @@ do_module_cmd(ulong flag, char *modref, ulong address,
}
if (flag == LIST_MODULE_HDR) {
- fprintf(fp, "%s %s %s OBJECT FILE\n",
+ fprintf(fp, "%s %s %s %s OBJECT FILE\n",
mkstring(buf1, VADDR_PRLEN, CENTER|LJUST,
"MODULE"),
mkstring(buf2, maxnamelen, LJUST, "NAME"),
+ mkstring(buf4, VADDR_PRLEN, CENTER|LJUST,
+ "BASE"),
mkstring(buf3, maxsizelen, RJUST, "SIZE"));
}
@@ -4509,6 +4512,8 @@ do_module_cmd(ulong flag, char *modref, ulong address,
LONG_HEX|RJUST, MKSTR(lm->module_struct)));
fprintf(fp, "%s ", mkstring(buf2, maxnamelen,
LJUST, lm->mod_name));
+ fprintf(fp, "%s ", mkstring(buf4, VADDR_PRLEN,
+ LONG_HEX|RJUST, MKSTR(lm->mod_base)));
fprintf(fp, "%s ", mkstring(buf3, maxsizelen,
RJUST|LONG_DEC, MKSTR(lm->mod_size)));
// fprintf(fp, "%6ld ", lm->mod_size);
-- 2.27.0