supplement the description of option --mem-usage
Subsystems (2)
PATCH 1/2 supplement the description of option --mem-usage
For now option --mem-usage is only used for x86-64, so supplement the description in man page and help message.
--- makedumpfile.8 | 1 + print_info.c | 1 + 2 files changed, 2 insertions(+)
makedumpfile.8 +1 -0
@@ -536,6 +536,7 @@ it is necessary to specfiy [\-x \fIVMLINUX\fR] or [\-i \fIVMCOREINFO\fR]. .TP \fB\-\-mem-usage\fR +This option is only for x86_64. This option is used to show the page numbers of current system in different use. It should be executed in 1st kernel. By the help of this, user can know how many pages is dumpable when different dump_level is specified. It analyzes
print_info.c +1 -0
@@ -268,6 +268,7 @@ print_usage(void)MSG (" necessary to specfiy [-x VMLINUX] or [-i VMCOREINFO].\n" );MSG ("\n" );MSG (" [--mem-usage]:\n" ); +MSG (" This option is only for x86_64.\n" );MSG (" This option is used to show the page numbers of current system in different\n" );MSG (" use. It should be executed in 1st kernel. By the help of this, user can know\n" );MSG (" how many pages is dumpable when different dump_level is specified. It analyzes\n" );
Signature · 7 lines
1.8.5.3 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH 2/2 message printing cleanup for option --mem-usage
Adjust the message printing when specify option --mem-usage. Try to avoid the unrelated printing.
And add the page size info.
--- makedumpfile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
makedumpfile.c +11 -8
@@ -4939,7 +4939,8 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)for (mm =0 ; mm < info->num_mem_map; mm++) { -print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); +if (!info->flag_mem_usage) +print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); mmd = &info->mem_map_data[mm];
@@ -4957,8 +4958,10 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)/* * print [100 %] */ -print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); -print_execution_time (PROGRESS_UNN_PAGES , &tv_start); +if (!info->flag_mem_usage) { +print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); +print_execution_time (PROGRESS_UNN_PAGES , &tv_start); + } }return TRUE;
@@ -7960,9 +7963,8 @@ print_mem_usage(void) shrinking = shrinking / pfn_original;MSG ("\n" ); -MSG ("\n" ); -MSG ("----------------------------------------------------------------------\n" );MSG ("TYPE PAGES EXCLUDABLE DESCRIPTION\n" ); +MSG ("----------------------------------------------------------------------\n" );MSG ("ZERO %-16llu yes Pages filled with zero\n" , pfn_zero);MSG ("CACHE %-16llu yes Cache pages\n" , pfn_cache);
@@ -7975,6 +7977,7 @@ print_mem_usage(void)MSG ("\n" ); +MSG ("page size: %-16ld\n" , info->page_size);MSG ("Total pages on system: %-16llu\n" , pfn_original); }
@@ -9614,10 +9617,10 @@ main(int argc, char *argv[]) retcd =COMPLETED ; out:MSG ("\n" ); -if (retcd ==COMPLETED ) -MSG ("makedumpfile Completed.\n" ); -else +if (retcd !=COMPLETED )MSG ("makedumpfile Failed.\n" ); +else if (!info->flag_mem_usage) +MSG ("makedumpfile Completed.\n" );if (info) {if (info->dh_memory)
Signature · 7 lines
1.8.5.3 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH 2/2] message printing cleanup for option --mem-usage
Hi,
So the output is like below now:
~$ ./makedumpfile --mem-usage /proc/kcore
The kernel version is not supported.
The makedumpfile operation may be incomplete.
TYPE PAGES EXCLUDABLE DESCRIPTION
----------------------------------------------------------------------
ZERO 28247 yes Pages filled
with zero
CACHE 240114 yes Cache pagesCACHE_PRIVATE 17902 yes Cache pages +
private
USER 19713 yes User process
pages
FREE 3639969 yes Free pagesKERN_DATA 103723 no Dumpable kernel
data
page size: 4096
Total pages on system: 4049668
That warning won't occur on kernel which makedumpfile declares to support, Just notice user the kernel they are using is not tested yet on compatibility. So it should not be a problem.
Thanks
Baoquan
Quoted 73 lines · Baoquan He
Adjust the message printing when specify option --mem-usage. Try to avoid the unrelated printing.
And add the page size info.
Signed-off-by Baoquan He <[email protected]>--- makedumpfile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)makedumpfile.c +11
-8@@ -4939,7 +4939,8 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)for (mm =0 ; mm < info->num_mem_map; mm++) { -print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); +if (!info->flag_mem_usage) +print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); mmd = &info->mem_map_data[mm];@@ -4957,8 +4958,10 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)/* * print [100 %] */ -print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); -print_execution_time (PROGRESS_UNN_PAGES , &tv_start); +if (!info->flag_mem_usage) { +print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); +print_execution_time (PROGRESS_UNN_PAGES , &tv_start); + } }return TRUE;@@ -7960,9 +7963,8 @@ print_mem_usage(void) shrinking = shrinking / pfn_original;MSG ("\n" ); -MSG ("\n" ); -MSG ("----------------------------------------------------------------------\n" );MSG ("TYPE PAGES EXCLUDABLE DESCRIPTION\n" ); +MSG ("----------------------------------------------------------------------\n" );MSG ("ZERO %-16llu yes Pages filled with zero\n" , pfn_zero);MSG ("CACHE %-16llu yes Cache pages\n" , pfn_cache);@@ -7975,6 +7977,7 @@ print_mem_usage(void)MSG ("\n" ); +MSG ("page size: %-16ld\n" , info->page_size);MSG ("Total pages on system: %-16llu\n" , pfn_original); }@@ -9614,10 +9617,10 @@ main(int argc, char *argv[]) retcd =COMPLETED ; out:MSG ("\n" ); -if (retcd ==COMPLETED ) -MSG ("makedumpfile Completed.\n" ); -else +if (retcd !=COMPLETED )MSG ("makedumpfile Failed.\n" ); +else if (!info->flag_mem_usage) +MSG ("makedumpfile Completed.\n" );if (info) {if (info->dh_memory)Signature · 1 line
1.8.5.3
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
RE: [PATCH 2/2] message printing cleanup for option --mem-usage
Hello,
Thanks for your quick work.
I have a suggestion below.
Quoted 21 lines
Hi,
So the output is like below now:
~$ ./makedumpfile --mem-usage
/proc/kcore
The kernel version is not supported.
The makedumpfile operation may be incomplete.TYPE PAGES EXCLUDABLE DESCRIPTION
----------------------------------------------------------------------
ZERO 28247 yes Pages filled
with zero
CACHE 240114 yes Cache pagesCACHE_PRIVATE17902 yes Cache pages +
private
USER 19713 yes User process
pages
FREE 3639969 yes Free pagesKERN_DATA103723 no Dumpable kernel
data
Quoted 2 lines
page size: 4096
Total pages on system: 4049668
I think it's better for users to print the total size also in byte unit. It's just a product of the page size and the number of pages, but it will be helpful since we generally count storage spaces in byte unit.
Thanks
Atsushi Kumagai
Quoted 78 lines
That warning won't occur on kernel which makedumpfile declares to support, Just notice user the kernel they are using is not tested yet on compatibility. So it should not be a problem.
Thanks
BaoquanQuoted 68 lines · Baoquan He
Adjust the message printing when specify option --mem-usage. Try to avoid the unrelated printing.
And add the page size info.
Signed-off-by Baoquan He <[email protected]>--- makedumpfile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)makedumpfile.c +11
-8@@ -4939,7 +4939,8 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)for (mm =0 ; mm < info->num_mem_map; mm++) { -print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); +if (!info->flag_mem_usage) +print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); mmd = &info->mem_map_data[mm];@@ -4957,8 +4958,10 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)/* * print [100 %] */ -print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); -print_execution_time (PROGRESS_UNN_PAGES , &tv_start); +if (!info->flag_mem_usage) { +print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); +print_execution_time (PROGRESS_UNN_PAGES , &tv_start); + } }return TRUE;@@ -7960,9 +7963,8 @@ print_mem_usage(void) shrinking = shrinking / pfn_original;MSG ("\n" ); -MSG ("\n" ); -MSG ("----------------------------------------------------------------------\n" );MSG ("TYPE PAGES EXCLUDABLE DESCRIPTION\n" ); +MSG ("----------------------------------------------------------------------\n" );MSG ("ZERO %-16llu yes Pages filled with zero\n" , pfn_zero);MSG ("CACHE %-16llu yes Cache pages\n" , pfn_cache);@@ -7975,6 +7977,7 @@ print_mem_usage(void)MSG ("\n" ); +MSG ("page size: %-16ld\n" , info->page_size);MSG ("Total pages on system: %-16llu\n" , pfn_original); }@@ -9614,10 +9617,10 @@ main(int argc, char *argv[]) retcd =COMPLETED ; out:MSG ("\n" ); -if (retcd ==COMPLETED ) -MSG ("makedumpfile Completed.\n" ); -else +if (retcd !=COMPLETED )MSG ("makedumpfile Failed.\n" ); +else if (!info->flag_mem_usage) +MSG ("makedumpfile Completed.\n" );
Quoted 10 lines
Quoted 5 lines
makedumpfile.c +0
-1if (info) {if (info->dh_memory) --1.8.5.3
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH 2/2] message printing cleanup for option --mem-usage
Quoted 26 lines · Atsushi Kumagai
Hello,
Thanks for your quick work.
I have a suggestion below.Quoted 21 lines
Hi,
So the output is like below now:
~$ ./makedumpfile --mem-usage
/proc/kcore
The kernel version is not supported.
The makedumpfile operation may be incomplete.TYPE PAGES EXCLUDABLE DESCRIPTION
----------------------------------------------------------------------
ZERO 28247 yes Pages filled
with zero
CACHE 240114 yes Cache pagesCACHE_PRIVATE17902 yes Cache pages +
private
USER 19713 yes User process
pages
FREE 3639969 yes Free pagesKERN_DATA103723 no Dumpable kernel
data
Quoted 7 lines
Quoted 2 lines
page size: 4096
Total pages on system: 4049668I think it's better for users to print the total size also in byte unit. It's just a product of the page size and the number of pages, but it will be helpful since we generally count storage spaces in byte unit.
Yeah, , people don't need to count in his head when he saw the page size and total pages. I am just a little worried it's a little reduendent. But I am fine with it, can repost it with that adding.
Quoted 93 lines
Thanks
Atsushi KumagaiQuoted 88 lines
That warning won't occur on kernel which makedumpfile declares to support, Just notice user the kernel they are using is not tested yet on compatibility. So it should not be a problem.
Thanks
BaoquanQuoted 71 lines · Baoquan He
Adjust the message printing when specify option --mem-usage. Try to avoid the unrelated printing.
And add the page size info.
Signed-off-by Baoquan He <[email protected]>--- makedumpfile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)makedumpfile.c +11
-9@@ -4939,7 +4939,8 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)for (mm =0 ; mm < info->num_mem_map; mm++) { -print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); +if (!info->flag_mem_usage) +print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); mmd = &info->mem_map_data[mm];@@ -4957,8 +4958,10 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)/* * print [100 %] */ -print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); -print_execution_time (PROGRESS_UNN_PAGES , &tv_start); +if (!info->flag_mem_usage) { +print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); +print_execution_time (PROGRESS_UNN_PAGES , &tv_start); + } }return TRUE;@@ -7960,9 +7963,8 @@ print_mem_usage(void) shrinking = shrinking / pfn_original;MSG ("\n" ); -MSG ("\n" ); -MSG ("----------------------------------------------------------------------\n" );MSG ("TYPE PAGES EXCLUDABLE DESCRIPTION\n" ); +MSG ("----------------------------------------------------------------------\n" );MSG ("ZERO %-16llu yes Pages filled with zero\n" , pfn_zero);MSG ("CACHE %-16llu yes Cache pages\n" , pfn_cache);@@ -7975,6 +7977,7 @@ print_mem_usage(void)MSG ("\n" ); +MSG ("page size: %-16ld\n" , info->page_size);MSG ("Total pages on system: %-16llu\n" , pfn_original); }@@ -9614,10 +9617,10 @@ main(int argc, char *argv[]) retcd =COMPLETED ; out:MSG ("\n" ); -if (retcd ==COMPLETED ) -MSG ("makedumpfile Completed.\n" ); -else +if (retcd !=COMPLETED )MSG ("makedumpfile Failed.\n" ); +else if (!info->flag_mem_usage) +MSG ("makedumpfile Completed.\n" );if (info) {if (info->dh_memory) --Quoted 2 lines
1.8.5.3
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
PATCH v2 2/2 message printing cleanup for option --mem-usage
In reply to Baoquan HeAdjust the message printing when specify option --mem-usage. Try to avoid the unrelated printing.
And add the page size info and the total size of system memory on byte.
--- makedumpfile.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
makedumpfile.c +14 -8
@@ -4939,7 +4939,8 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)for (mm =0 ; mm < info->num_mem_map; mm++) { -print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); +if (!info->flag_mem_usage) +print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); mmd = &info->mem_map_data[mm];
@@ -4957,8 +4958,10 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)/* * print [100 %] */ -print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); -print_execution_time (PROGRESS_UNN_PAGES , &tv_start); +if (!info->flag_mem_usage) { +print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); +print_execution_time (PROGRESS_UNN_PAGES , &tv_start); + } }return TRUE;
@@ -7948,6 +7951,7 @@ static voidprint_mem_usage (void) {mdf_pfn_t pfn_original, pfn_excluded, shrinking; +unsigned long long total_size;/* * /proc/vmcore doesn't contain the memory hole area.
@@ -7958,11 +7962,11 @@ print_mem_usage(void) + pfn_user + pfn_free + pfn_hwpoison; shrinking = (pfn_original - pfn_excluded) *100 ; shrinking = shrinking / pfn_original; + total_size = info->page_size * pfn_original;MSG ("\n" ); -MSG ("\n" ); -MSG ("----------------------------------------------------------------------\n" );MSG ("TYPE PAGES EXCLUDABLE DESCRIPTION\n" ); +MSG ("----------------------------------------------------------------------\n" );MSG ("ZERO %-16llu yes Pages filled with zero\n" , pfn_zero);MSG ("CACHE %-16llu yes Cache pages\n" , pfn_cache);
@@ -7975,7 +7979,9 @@ print_mem_usage(void)MSG ("\n" ); +MSG ("page size: %-16ld\n" , info->page_size);MSG ("Total pages on system: %-16llu\n" , pfn_original); +MSG ("Total size on system: %-16llu Byte\n" , total_size); }int
@@ -9614,10 +9620,10 @@ main(int argc, char *argv[]) retcd =COMPLETED ; out:MSG ("\n" ); -if (retcd ==COMPLETED ) -MSG ("makedumpfile Completed.\n" ); -else +if (retcd !=COMPLETED )MSG ("makedumpfile Failed.\n" ); +else if (!info->flag_mem_usage) +MSG ("makedumpfile Completed.\n" );if (info) {if (info->dh_memory)
Signature · 8 lines
1.8.5.3 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
RE: [PATCH v2 2/2] message printing cleanup for option --mem-usage
Quoted 4 lines
Adjust the message printing when specify option --mem-usage. Try to avoid the unrelated printing.
And add the page size info and the total size of system memory on byte.
Looks good to me, thanks. I've pushed this to devel.
Thanks
Atsushi Kumagai
Quoted 76 lines
Signed-off-by Baoquan He <[email protected]>---
makedumpfile.c| 22 ++++++++++++++--------1 file changed, 14 insertions(+), 8 deletions(-)makedumpfile.c +11
-5@@ -4939,7 +4939,8 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)for (mm =0 ; mm < info->num_mem_map; mm++) { -print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); +if (!info->flag_mem_usage) +print_progress (PROGRESS_UNN_PAGES , mm, info->num_mem_map); mmd = &info->mem_map_data[mm];@@ -4957,8 +4958,10 @@ exclude_unnecessary_pages_cyclic(struct cycle *cycle)/* * print [100 %] */ -print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); -print_execution_time (PROGRESS_UNN_PAGES , &tv_start); +if (!info->flag_mem_usage) { +print_progress (PROGRESS_UNN_PAGES , info->num_mem_map, info->num_mem_map); +print_execution_time (PROGRESS_UNN_PAGES , &tv_start); + } }return TRUE;@@ -7948,6 +7951,7 @@ static voidprint_mem_usage (void) {mdf_pfn_t pfn_original, pfn_excluded, shrinking; +unsigned long long total_size;/* * /proc/vmcore doesn't contain the memory hole area. @@ -7958,11 +7962,11 @@ print_mem_usage(void) + pfn_user + pfn_free + pfn_hwpoison; shrinking = (pfn_original - pfn_excluded) *100 ; shrinking = shrinking / pfn_original; + total_size = info->page_size * pfn_original;MSG ("\n" ); -MSG ("\n" ); -MSG ("----------------------------------------------------------------------\n" );MSG ("TYPE PAGES EXCLUDABLE DESCRIPTION\n" ); +MSG ("----------------------------------------------------------------------\n" );MSG ("ZERO %-16llu yes Pages filled with zero\n" , pfn_zero);MSG ("CACHE %-16llu yes Cache pages\n" , pfn_cache);@@ -7975,7 +7979,9 @@ print_mem_usage(void)MSG ("\n" ); +MSG ("page size: %-16ld\n" , info->page_size);MSG ("Total pages on system: %-16llu\n" , pfn_original); +MSG ("Total size on system: %-16llu Byte\n" , total_size); }int
makedumpfile.c +0
-0@@ -9614,10 +9620,10 @@ main(int argc, char *argv[]) retcd =COMPLETED ;out:
MSG("\n");makedumpfile.c +1
-3-if (retcd ==COMPLETED ) -MSG ("makedumpfile Completed.\n" ); -else +if (retcd !=COMPLETED )MSG("makedumpfile Failed.\n");makedumpfile.c +2
-0+else if (!info->flag_mem_usage) +MSG ("makedumpfile Completed.\n" );
Quoted 5 lines
if (info) { if (info->dh_memory)--
1.8.5.3
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec