[ofa-general] Re: [PATCH RFC] opensm: drop unused parameter in OSM_LOG_ENTER macro
Hal Rosenstock
hrosenstock at xsigo.com
Sat Feb 16 07:37:56 PST 2008
On Fri, 2008-02-15 at 16:06 +0000, Sasha Khapyorsky wrote:
> 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)
This seems functionally equivalent as all functions supplied in second
parameter to OSM_LOG_ENTER are indeed the function being entered.
> 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?
Do all instances of osm_log use the function they are in ? For those
that do, this seems fine but I'm not sure all of them do.
-- Hal
> IMO it would save even more "grepping" time.
>
> Sasha
More information about the general
mailing list