lwip-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-members] RFC: improved debugging


From: Jani Monoses
Subject: Re: [lwip-members] RFC: improved debugging
Date: Fri, 13 Dec 2002 19:09:05 +0200

Hi
I've been offline for the past 2 weeks (due to "technical
difficulties" moving office etc..) hence the inactivity....
I'll hopefully start on some issues in the fine buglist Kieran 
put on the site soon :)
WRT debug it would be useful to have the switches only in lwipopts
and not to mess with lwip/debug.h at all.
So platforms could override DEBUGF and ASSERT which are unixy right now.
Jani.

> Hello,
> 
> I would like to propose more fine-grained control over debug message
> output.
> 
> Besides introducing some debug severity levels, I would like to introduce
> the
> concept of debug message type.
> 
> The goals are to be able to
> - switch certain types of debugging on or off.
> - have a debug threshold so that the verbosity can be controlled.
> 
> I would to keep to current interface, just use some extra bits in the debug
> byte :
> (currently has values 0 or 1).
> 
> Types:
> 
> DBG_TRACE 0x80
> DBG_STATE 0x40
> DBG_FRESH 0x20
> 
> bit 0 indicates whether the debug message is enabled at all.
> (to maintain backwards compatibility).
> 
> Levels 0-3 (in bits 1 and 2):
> level 0 means lowest severity
> level 3 means highest severity
> 
> DBG_TRACE allows one to follow the program flow
> (i.e. there is exactly one DBG_TRACE statement per C block, so
> that all branch decisions, function calls and loops can be traced.)
> 
> DBG_STATE allows one to keep track of the state of a module.
> (like the contents of the ARP cache, or the linked list of the memory
> allocator).
> 
> DBG_FRESH allows one to mark new code and extend debugging.
> 
> Examples:
> 
> DEBUGF(DBG_TRACE | DBG_DHCP, "dhcp_renew(): Renewing IP address lease.");
> DEBUGF(DBG_TRACE | DBG_ETHARP, "etharp_ip_input(): Sending queued
> packets.");
> DEBUGF(DBG_STATE | DBG_ETHARP, "etharp table[i]: %u.%u.%u.%u -
> %02x:%02x:%02x:%02x:%02x:%02x", ...);
> DEBUGF(DBG_FRESH | DBG_STATE | DBG_ETHARP, "etharp table[i]: adding packet
> %p to the queue.", ...);
> 
> Bits 3 and 4 are reserved for future use (expand debug types or levels).
> 
> I am going to use this debugging interface on the etharp module.
> 
> In the meantime, I am open to comments. :-)
> 
> Regards,
> 
> Leon.
> 
> 
> 
> _______________________________________________
> lwip-members mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-members



reply via email to

[Prev in Thread] Current Thread [Next in Thread]