[Crash-utility] Re: [PATCH] crash: memory.c handling of node_online_map

Dave Anderson anderson at redhat.com
Tue Sep 2 15:18:31 UTC 2008


----- "Cliff Wickman" <cpw at sgi.com> wrote:

> This patch enables finding of node_states (instead of
> node_online_map)
> when using a kerntypes file for a namelist.
> 
> I tested this against the dump of a 2.6.26 kernel.

Looks OK and only changes LKCD_KERNTYPES() behavior -- queued for the next release.

Dave

> 
> Diffed against crash-4.0-7.1
> 
> Signed-off-by: Cliff Wickman <cpw at sgi.com>
> 
> ---
>  memory.c |   19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> Index: crash-4.0-7.1/memory.c
> ===================================================================
> --- crash-4.0-7.1.orig/memory.c
> +++ crash-4.0-7.1/memory.c
> @@ -12850,14 +12850,17 @@ get_nodes_online(void)
>  	    !symbol_exists("node_states")) 
>  		return 0;
>  
> -	if (LKCD_KERNTYPES()) {
> -                if ((len = STRUCT_SIZE("nodemask_t")) < 0)
> -       			error(FATAL, "cannot determine type nodemask_t\n");
> -		mapaddr = symbol_value("node_online_map");
> -	} else if (symbol_exists("node_online_map")) {
> -		len = get_symbol_type("node_online_map", NULL, &req)
> -			== TYPE_CODE_UNDEF ?  sizeof(ulong) : req.length;
> -		mapaddr = symbol_value("node_online_map");
> +	if (symbol_exists("node_online_map")) {
> +		if (LKCD_KERNTYPES()) {
> +                	if ((len = STRUCT_SIZE("nodemask_t")) < 0)
> +       				error(FATAL,
> +					"cannot determine type nodemask_t\n");
> +			mapaddr = symbol_value("node_online_map");
> +		} else {
> +			len = get_symbol_type("node_online_map", NULL, &req)
> +			    == TYPE_CODE_UNDEF ?  sizeof(ulong) : req.length;
> +			mapaddr = symbol_value("node_online_map");
> +		}
>  	} else if (symbol_exists("node_states")) {
>  		if ((get_symbol_type("node_states", NULL, &req) != TYPE_CODE_ARRAY)
> ||
>  		    !(len = get_array_length("node_states", NULL, 0)) ||




More information about the Crash-utility mailing list