[Crash-utility] [PATCH] Show the module's base address for "mod" command

HAGIO KAZUHITO(萩尾 一仁) k-hagio-ab at nec.com
Mon Jan 25 06:55:40 UTC 2021


-----Original Message-----
> 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.
> 
> Signed-off-by: Yunfeng Ye <yeyunfeng at huawei.com>

Thanks for the patch, it looks good and would be useful.

Acked-by: Kazuhito Hagio <k-hagio-ab at nec.com>

Please wait for another ack.

Lianbo, Bhupesh, I will update the help page this time.

Thanks,
Kazu

> ---
>  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
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility





More information about the Crash-utility mailing list