summaryrefslogtreecommitdiffstats
path: root/src/net/retry.c
diff options
context:
space:
mode:
authorMichael Brown2006-08-30 15:39:07 +0200
committerMichael Brown2006-08-30 15:39:07 +0200
commit095fce14f8b1c23e76d7088b73c1717a3b24e86c (patch)
treee85c434a2b01b2a973c99a2ac8e17669edb7c638 /src/net/retry.c
parent.zrom is still broken; use .rom by default (diff)
downloadipxe-095fce14f8b1c23e76d7088b73c1717a3b24e86c.tar.gz
ipxe-095fce14f8b1c23e76d7088b73c1717a3b24e86c.tar.xz
ipxe-095fce14f8b1c23e76d7088b73c1717a3b24e86c.zip
Added extra debugging
Diffstat (limited to 'src/net/retry.c')
-rw-r--r--src/net/retry.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/net/retry.c b/src/net/retry.c
index 07b4af4c..0fb47952 100644
--- a/src/net/retry.c
+++ b/src/net/retry.c
@@ -64,10 +64,11 @@ static LIST_HEAD ( timers );
* be stopped and the timer's callback function will be called.
*/
void start_timer ( struct retry_timer *timer ) {
- list_add ( &timer->list, &timers );
timer->start = currticks();
if ( timer->timeout < MIN_TIMEOUT )
timer->timeout = MIN_TIMEOUT;
+ list_add ( &timer->list, &timers );
+ DBG2 ( "Timer %p started\n", timer );
}
/**
@@ -81,6 +82,7 @@ void stop_timer ( struct retry_timer *timer ) {
unsigned long old_timeout = timer->timeout;
unsigned long runtime;
+ DBG2 ( "Timer %p stopped\n", timer );
list_del ( &timer->list );
runtime = currticks() - timer->start;
@@ -105,7 +107,7 @@ void stop_timer ( struct retry_timer *timer ) {
timer->timeout -= ( timer->timeout >> 3 );
timer->timeout += ( runtime >> 1 );
if ( timer->timeout != old_timeout ) {
- DBG ( "Timer updated to %dms\n",
+ DBG ( "Timer %p updated to %ldms\n", timer,
( ( 1000 * timer->timeout ) / TICKS_PER_SEC ) );
}
}
@@ -120,6 +122,7 @@ static void timer_expired ( struct retry_timer *timer ) {
int fail;
/* Stop timer without performing RTT calculations */
+ DBG2 ( "Timer %p stopped on expiry\n", timer );
list_del ( &timer->list );
timer->count++;
@@ -127,7 +130,7 @@ static void timer_expired ( struct retry_timer *timer ) {
timer->timeout <<= 1;
if ( ( fail = ( timer->timeout > MAX_TIMEOUT ) ) )
timer->timeout = MAX_TIMEOUT;
- DBG ( "Timer backed off to %dms\n",
+ DBG ( "Timer %p backed off to %ldms\n", timer,
( ( 1000 * timer->timeout ) / TICKS_PER_SEC ) );
/* Call expiry callback */