All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] supplement the description of option --mem-usage
@ 2014-09-03  9:13 Baoquan He
  2014-09-03  9:13 ` [PATCH 2/2] message printing cleanup for " Baoquan He
  0 siblings, 1 reply; 7+ messages in thread
From: Baoquan He @ 2014-09-03  9:13 UTC (permalink / raw)
  To: kexec; +Cc: kumagai-atsushi, Baoquan He, vgoyal

For now option --mem-usage is only used for x86-64, so supplement the
description in man page and help message.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 makedumpfile.8 | 1 +
 print_info.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/makedumpfile.8 b/makedumpfile.8
index e6a2dac..0211cd9 100644
--- a/makedumpfile.8
+++ b/makedumpfile.8
@@ -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
diff --git a/print_info.c b/print_info.c
index a1232f4..f6342d3 100644
--- a/print_info.c
+++ b/print_info.c
@@ -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");
-- 
1.8.5.3


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] message printing cleanup for option --mem-usage
  2014-09-03  9:13 [PATCH 1/2] supplement the description of option --mem-usage Baoquan He
@ 2014-09-03  9:13 ` Baoquan He
  2014-09-03  9:20   ` Baoquan He
  2014-09-09  3:26   ` [PATCH v2 " Baoquan He
  0 siblings, 2 replies; 7+ messages in thread
From: Baoquan He @ 2014-09-03  9:13 UTC (permalink / raw)
  To: kexec; +Cc: kumagai-atsushi, Baoquan He, vgoyal

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 <bhe@redhat.com>
---
 makedumpfile.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index c965745..f804079 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -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)
-- 
1.8.5.3


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] message printing cleanup for option --mem-usage
  2014-09-03  9:13 ` [PATCH 2/2] message printing cleanup for " Baoquan He
@ 2014-09-03  9:20   ` Baoquan He
  2014-09-08  5:51     ` Atsushi Kumagai
  2014-09-09  3:26   ` [PATCH v2 " Baoquan He
  1 sibling, 1 reply; 7+ messages in thread
From: Baoquan He @ 2014-09-03  9:20 UTC (permalink / raw)
  To: kexec; +Cc: kumagai-atsushi, vgoyal

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 pages
CACHE_PRIVATE	17902           	yes		Cache pages +
private
USER		19713           	yes		User process
pages
FREE		3639969         	yes		Free pages
KERN_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


On 09/03/14 at 05:13pm, Baoquan He wrote:
> 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 <bhe@redhat.com>
> ---
>  makedumpfile.c | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/makedumpfile.c b/makedumpfile.c
> index c965745..f804079 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -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)
> -- 
> 1.8.5.3
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] message printing cleanup for option --mem-usage
  2014-09-03  9:20   ` Baoquan He
@ 2014-09-08  5:51     ` Atsushi Kumagai
  2014-09-09  3:02       ` bhe
  0 siblings, 1 reply; 7+ messages in thread
From: Atsushi Kumagai @ 2014-09-08  5:51 UTC (permalink / raw)
  To: bhe; +Cc: kexec, vgoyal

Hello,

Thanks for your quick work.
I have a suggestion below.

>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 pages
>CACHE_PRIVATE	17902           	yes		Cache pages +
>private
>USER		19713           	yes		User process
>pages
>FREE		3639969         	yes		Free pages
>KERN_DATA	103723          	no		Dumpable kernel
>data
>
>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

>
>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
>
>
>On 09/03/14 at 05:13pm, Baoquan He wrote:
>> 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 <bhe@redhat.com>
>> ---
>>  makedumpfile.c | 19 +++++++++++--------
>>  1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/makedumpfile.c b/makedumpfile.c
>> index c965745..f804079 100644
>> --- a/makedumpfile.c
>> +++ b/makedumpfile.c
>> @@ -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)
>> --
>> 1.8.5.3
>>
>
>_______________________________________________
>kexec mailing list
>kexec@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] message printing cleanup for option --mem-usage
  2014-09-08  5:51     ` Atsushi Kumagai
@ 2014-09-09  3:02       ` bhe
  0 siblings, 0 replies; 7+ messages in thread
From: bhe @ 2014-09-09  3:02 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: kexec, vgoyal

On 09/08/14 at 05:51am, Atsushi Kumagai wrote:
> Hello,
> 
> Thanks for your quick work.
> I have a suggestion below.
> 
> >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 pages
> >CACHE_PRIVATE	17902           	yes		Cache pages +
> >private
> >USER		19713           	yes		User process
> >pages
> >FREE		3639969         	yes		Free pages
> >KERN_DATA	103723          	no		Dumpable kernel
> >data
> >
> >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.

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.

> 
> 
> Thanks 
> Atsushi Kumagai
> 
> >
> >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
> >
> >
> >On 09/03/14 at 05:13pm, Baoquan He wrote:
> >> 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 <bhe@redhat.com>
> >> ---
> >>  makedumpfile.c | 19 +++++++++++--------
> >>  1 file changed, 11 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/makedumpfile.c b/makedumpfile.c
> >> index c965745..f804079 100644
> >> --- a/makedumpfile.c
> >> +++ b/makedumpfile.c
> >> @@ -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)
> >> --
> >> 1.8.5.3
> >>
> >
> >_______________________________________________
> >kexec mailing list
> >kexec@lists.infradead.org
> >http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] message printing cleanup for option --mem-usage
  2014-09-03  9:13 ` [PATCH 2/2] message printing cleanup for " Baoquan He
  2014-09-03  9:20   ` Baoquan He
@ 2014-09-09  3:26   ` Baoquan He
  2014-09-10  8:16     ` Atsushi Kumagai
  1 sibling, 1 reply; 7+ messages in thread
From: Baoquan He @ 2014-09-09  3:26 UTC (permalink / raw)
  To: kexec; +Cc: kumagai-atsushi, vgoyal

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.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 makedumpfile.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index c965745..8667791 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -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 void
 print_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)
-- 
1.8.5.3



_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH v2 2/2] message printing cleanup for option --mem-usage
  2014-09-09  3:26   ` [PATCH v2 " Baoquan He
@ 2014-09-10  8:16     ` Atsushi Kumagai
  0 siblings, 0 replies; 7+ messages in thread
From: Atsushi Kumagai @ 2014-09-10  8:16 UTC (permalink / raw)
  To: bhe; +Cc: kexec, vgoyal

>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

>Signed-off-by: Baoquan He <bhe@redhat.com>
>---
> makedumpfile.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
>diff --git a/makedumpfile.c b/makedumpfile.c
>index c965745..8667791 100644
>--- a/makedumpfile.c
>+++ b/makedumpfile.c
>@@ -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 void
> print_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)
>--
>1.8.5.3
>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-10  8:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03  9:13 [PATCH 1/2] supplement the description of option --mem-usage Baoquan He
2014-09-03  9:13 ` [PATCH 2/2] message printing cleanup for " Baoquan He
2014-09-03  9:20   ` Baoquan He
2014-09-08  5:51     ` Atsushi Kumagai
2014-09-09  3:02       ` bhe
2014-09-09  3:26   ` [PATCH v2 " Baoquan He
2014-09-10  8:16     ` Atsushi Kumagai

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.