[ofa-general] Re: Stringify ibv_event_type

Jeff Squyres jsquyres at cisco.com
Thu Jun 21 14:58:35 PDT 2007


On Jun 21, 2007, at 2:55 PM, Michael S. Tsirkin wrote:

> I have no strong opinion either way, but I do wonder why do you  
> find this useful?

The more verbose an error message, the more chance a user has to  
understand it.

> Asyncwatch is just an example: it does not actually *do anything*  
> on an event,
> so it calls printf. But, is it likely that enduser really needs to see
> IBV_EVENT_CLIENT_REREGISTER? Printing out the numerc value seems
> sufficient for debug.

Why have to force a secondary lookup (that may involve multiple  
steps)?  Printing a string is easy.

Plus, what if the enum values change over time?  Then we'll have to  
have the user send us the error message and their verbs.h to find out  
what the problem really is.  If you print the enum value as a string,  
it's pretty clear (to a developer at least) what the problem is/could  
be regardless of what the actual numerical value is (indeed, who  
cares what the numerical value is?).  Heck, some of the enum names  
are fairly obvious such that even a reasonably-skilled user could  
figure out at least the context of the error.

Just my $0.02.

-- 
Jeff Squyres
Cisco Systems




More information about the general mailing list