[ofa-general] Re: [PATCH] opensm/console: Enhance perfmgr print_counters for better nodenames

Sasha Khapyorsky sashak at voltaire.com
Wed Feb 25 22:15:51 PST 2009


On 08:06 Thu 19 Feb     , Hal Rosenstock wrote:
> 
> nodenames can have spaces in them
> Also, no need for next_token being inlined
> 
> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>

Applied with changes noted below. Thanks.

[snip...]

> diff --git a/opensm/opensm/osm_perfmgr.c b/opensm/opensm/osm_perfmgr.c
> index 3babe3a..8766f93 100644
> --- a/opensm/opensm/osm_perfmgr.c
> +++ b/opensm/opensm/osm_perfmgr.c
> @@ -1304,9 +1304,9 @@ void
>  osm_perfmgr_print_counters(osm_perfmgr_t *pm, char *nodename, FILE *fp)
>  {
>  	uint64_t guid = strtoull(nodename, NULL, 0);
> -	if (guid == 0 && errno == EINVAL)
> +	if (guid == 0 && errno)	// name
>  		perfmgr_db_print_by_name(pm->db, nodename, fp);
> -	else
> +	else		// guid
>  		perfmgr_db_print_by_guid(pm->db, guid, fp);

Such comments are not really helpful - it is pretty clear from the code
(flow itself and function names too) what is going on there, so I'm
removing this.

And in general I think it is better to use C-style comments - /* ... */,
in C code and not C++-style // ... .

Sasha



More information about the general mailing list