From 258fe8823260e6281723d69c5776a60ec93d17a5 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Thu, 4 Feb 2010 16:53:10 +0000 Subject: [PATCH] Added an own debug-print option for timers.c (used TCPIP_DEBUG and SYS_DEBUG as the code was copied from there) --- src/core/timers.c | 26 +++++++++++++------------- src/include/lwip/opt.h | 7 +++++++ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/core/timers.c b/src/core/timers.c index d437c923..84e933b2 100644 --- a/src/core/timers.c +++ b/src/core/timers.c @@ -114,7 +114,7 @@ static void ip_reass_timer(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: ip_reass_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: ip_reass_tmr()\n")); ip_reass_tmr(); sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL); } @@ -130,7 +130,7 @@ static void arp_timer(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: etharp_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n")); etharp_tmr(); sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); } @@ -146,7 +146,7 @@ static void dhcp_timer_coarse(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: dhcp_coarse_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_coarse_tmr()\n")); dhcp_coarse_tmr(); sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL); } @@ -160,7 +160,7 @@ static void dhcp_timer_fine(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: dhcp_fine_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_fine_tmr()\n")); dhcp_fine_tmr(); sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL); } @@ -176,7 +176,7 @@ static void autoip_timer(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: autoip_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: autoip_tmr()\n")); autoip_tmr(); sys_timeout(AUTOIP_TMR_INTERVAL, autoip_timer, NULL); } @@ -192,7 +192,7 @@ static void igmp_timer(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: igmp_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: igmp_tmr()\n")); igmp_tmr(); sys_timeout(IGMP_TMR_INTERVAL, igmp_timer, NULL); } @@ -208,7 +208,7 @@ static void dns_timer(void *arg) { LWIP_UNUSED_ARG(arg); - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip: dns_tmr()\n")); + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dns_tmr()\n")); dns_tmr(); sys_timeout(DNS_TMR_INTERVAL, dns_timer, NULL); } @@ -277,10 +277,10 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg) #endif /* LWIP_DEBUG_TIMERNAMES */ #if LWIP_DEBUG_TIMERNAMES - LWIP_DEBUGF(SYS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p name=%s\n", + LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p name=%s\n", (void *)timeout, msecs, *(void**)&h, (void *)arg, handler_name)); #else /* LWIP_DEBUG_TIMERNAMES */ - LWIP_DEBUGF(SYS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p\n", + LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" h=%p arg=%p\n", (void *)timeout, msecs, *(void**)&h, (void *)arg)); #endif /* LWIP_DEBUG_TIMERNAMES */ @@ -390,9 +390,9 @@ sys_check_timeouts(void) memp_free(MEMP_SYS_TIMEOUT, tmptimeout); if (h != NULL) { #if LWIP_DEBUG_TIMERNAMES - LWIP_DEBUGF(SYS_DEBUG, ("sct calling h=%p(%p) (%s)\n", *(void**)&h, arg, handler_name)); + LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%p(%p) (%s)\n", *(void**)&h, arg, handler_name)); #else /* LWIP_DEBUG_TIMERNAMES */ - LWIP_DEBUGF(SYS_DEBUG, ("sct calling h=%p(%p)\n", *(void**)&h, arg)); + LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%p(%p)\n", *(void**)&h, arg)); #endif /* LWIP_DEBUG_TIMERNAMES */ h(arg); } @@ -446,9 +446,9 @@ sys_timeouts_mbox_fetch(sys_mbox_t mbox, void **msg) memp_free(MEMP_SYS_TIMEOUT, tmptimeout); if (h != NULL) { #if LWIP_DEBUG_TIMERNAMES - LWIP_DEBUGF(SYS_DEBUG, ("stmf calling h=%p(%p) (%s)\n", *(void**)&h, arg, handler_name)); + LWIP_DEBUGF(TIMERS_DEBUG, ("stmf calling h=%p(%p) (%s)\n", *(void**)&h, arg, handler_name)); #else /* LWIP_DEBUG_TIMERNAMES */ - LWIP_DEBUGF(SYS_DEBUG, ("stmf calling h=%p(%p)\n", *(void**)&h, arg)); + LWIP_DEBUGF(TIMERS_DEBUG, ("stmf calling h=%p(%p)\n", *(void**)&h, arg)); #endif /* LWIP_DEBUG_TIMERNAMES */ /* For LWIP_TCPIP_CORE_LOCKING, lock the core before calling the timeout handler function. */ diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 8509a3f0..c7e92c35 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -1804,6 +1804,13 @@ #define SYS_DEBUG LWIP_DBG_OFF #endif +/** + * TIMERS_DEBUG: Enable debugging in timers.c. + */ +#ifndef TIMERS_DEBUG +#define TIMERS_DEBUG LWIP_DBG_OFF +#endif + /** * TCP_DEBUG: Enable debugging for TCP. */