FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 10-22-2010, 01:39 PM
Per Fransson
 
Default no swapper_space

Hi Dave,

"kmem -i" aborts before it completes when swapping isn't enabled. This is a suggestion for fixing it.

Regards,
Per


diff --git a/memory.c b/memory.c
index 287285f..cb02c57 100755
--- a/memory.c
+++ b/memory.c
@@ -6717,7 +6717,7 @@ dump_kmeminfo(void)
} else if (dump_vm_stat("NR_FILE_PAGES", &nr_file_pages, 0)) {
char *swapper_space = GETBUF(SIZE(address_space));

- if (!readmem(symbol_value("swapper_space"), KVADDR, swapper_space,
+ if (!symbol_exists("swapper_space") || !readmem(symbol_value("swapper_space"), KVADDR, swapper_space,
SIZE(address_space), "swapper_space", RETURN_ON_ERROR))
swapper_space_nrpages = 0;
else
@@ -6796,7 +6796,8 @@ dump_kmeminfo(void)
* get swap data from dump_swap_info().
*/
fprintf(fp, "
");
- if (dump_swap_info(RETURN_ON_ERROR, &totalswap_pages,
+ if (symbol_exists("swapper_space")) {
+ if (dump_swap_info(RETURN_ON_ERROR, &totalswap_pages,
&totalused_pages)) {
fprintf(fp, "%10s %7ld %11s ----
",
"TOTAL SWAP", totalswap_pages,
@@ -6816,7 +6817,7 @@ dump_kmeminfo(void)
} else
error(INFO, "swap_info[%ld].swap_map at %lx is inaccessible
",
totalused_pages, totalswap_pages);
-
+ }
dump_zone_page_usage();
}


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 10-22-2010, 02:06 PM
Dave Anderson
 
Default no swapper_space

----- "Per Fransson" <per.xx.fransson@stericsson.com> wrote:

> Hi Dave,
>
> "kmem -i" aborts before it completes when swapping isn't enabled. This
> is a suggestion for fixing it.
>
> Regards,
> Per

Looks safe enough -- re-formatted and queued for the next release.

Thanks,
Dave

>
> diff --git a/memory.c b/memory.c
> index 287285f..cb02c57 100755
> --- a/memory.c
> +++ b/memory.c
> @@ -6717,7 +6717,7 @@ dump_kmeminfo(void)
> } else if (dump_vm_stat("NR_FILE_PAGES", &nr_file_pages, 0)) {
> char *swapper_space = GETBUF(SIZE(address_space));
>
> - if (!readmem(symbol_value("swapper_space"), KVADDR, swapper_space,
> + if (!symbol_exists("swapper_space") || !readmem(symbol_value("swapper_space"), KVADDR, swapper_space,
> SIZE(address_space), "swapper_space", RETURN_ON_ERROR))
> swapper_space_nrpages = 0;
> else
> @@ -6796,7 +6796,8 @@ dump_kmeminfo(void)
> * get swap data from dump_swap_info().
> */
> fprintf(fp, "
");
> - if (dump_swap_info(RETURN_ON_ERROR, &totalswap_pages,
> + if (symbol_exists("swapper_space")) {
> + if (dump_swap_info(RETURN_ON_ERROR, &totalswap_pages,
> &totalused_pages)) {
> fprintf(fp, "%10s %7ld %11s ----
",
> "TOTAL SWAP", totalswap_pages,
> @@ -6816,7 +6817,7 @@ dump_kmeminfo(void)
> } else
> error(INFO, "swap_info[%ld].swap_map at %lx is inaccessible
",
> totalused_pages, totalswap_pages);
> -
> + }
> dump_zone_page_usage();
> }

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 11:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org