[ofa-general] Re: [PATCH RFC] opensm: drop unused parameter in OSM_LOG_ENTER macro

Sasha Khapyorsky sashak at voltaire.com
Fri Feb 15 08:06:32 PST 2008


On 18:18 Tue 12 Feb     , Sasha Khapyorsky wrote:
> 
> __func__ macro is used in the OSM_LOG_ENTER() to show an actual function
> name, so the second parameter is not really useful here. OTOH it makes
> it harder to grep over OpenSM source code, when searches are by function
> names it generates a lot of unrelated matches. If so what about to
> remove this second parameter (like in this patch)?

And if we are doing this (I didn't get any negative feedback up to now)
what about a next step - to clean up function names in osm_log format
string?

Something like to have OSM_LOG() macro:

#define OSM_LOG(log, level, fmt, arg...) osm_log(log, level, \
		"%s: " fmt , __func__, ##arg)

, and use this macro instead of osm_log() where function name should be
logged?

IMO it would save even more "grepping" time.

Sasha



More information about the general mailing list