mirror of https://github.com/ipxe/ipxe.git
[retry] Colourise debug output
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/34/head
parent
47ad8fc1ba
commit
93b4586447
|
@ -76,8 +76,8 @@ void start_timer_fixed ( struct retry_timer *timer, unsigned long timeout ) {
|
||||||
/* Record timeout */
|
/* Record timeout */
|
||||||
timer->timeout = timeout;
|
timer->timeout = timeout;
|
||||||
|
|
||||||
DBG2 ( "Timer %p started at time %ld (expires at %ld)\n",
|
DBGC2 ( timer, "Timer %p started at time %ld (expires at %ld)\n",
|
||||||
timer, timer->start, ( timer->start + timer->timeout ) );
|
timer, timer->start, ( timer->start + timer->timeout ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,8 +126,8 @@ void stop_timer ( struct retry_timer *timer ) {
|
||||||
list_del ( &timer->list );
|
list_del ( &timer->list );
|
||||||
runtime = ( now - timer->start );
|
runtime = ( now - timer->start );
|
||||||
timer->running = 0;
|
timer->running = 0;
|
||||||
DBG2 ( "Timer %p stopped at time %ld (ran for %ld)\n",
|
DBGC2 ( timer, "Timer %p stopped at time %ld (ran for %ld)\n",
|
||||||
timer, now, runtime );
|
timer, now, runtime );
|
||||||
|
|
||||||
/* Update timer. Variables are:
|
/* Update timer. Variables are:
|
||||||
*
|
*
|
||||||
|
@ -150,8 +150,8 @@ void stop_timer ( struct retry_timer *timer ) {
|
||||||
timer->timeout -= ( timer->timeout >> 3 );
|
timer->timeout -= ( timer->timeout >> 3 );
|
||||||
timer->timeout += ( runtime >> 1 );
|
timer->timeout += ( runtime >> 1 );
|
||||||
if ( timer->timeout != old_timeout ) {
|
if ( timer->timeout != old_timeout ) {
|
||||||
DBG ( "Timer %p timeout updated to %ld\n",
|
DBGC ( timer, "Timer %p timeout updated to %ld\n",
|
||||||
timer, timer->timeout );
|
timer, timer->timeout );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +169,8 @@ static void timer_expired ( struct retry_timer *timer ) {
|
||||||
int fail;
|
int fail;
|
||||||
|
|
||||||
/* Stop timer without performing RTT calculations */
|
/* Stop timer without performing RTT calculations */
|
||||||
DBG2 ( "Timer %p stopped at time %ld on expiry\n",
|
DBGC2 ( timer, "Timer %p stopped at time %ld on expiry\n",
|
||||||
timer, currticks() );
|
timer, currticks() );
|
||||||
assert ( timer->running );
|
assert ( timer->running );
|
||||||
list_del ( &timer->list );
|
list_del ( &timer->list );
|
||||||
timer->running = 0;
|
timer->running = 0;
|
||||||
|
@ -180,8 +180,8 @@ static void timer_expired ( struct retry_timer *timer ) {
|
||||||
timer->timeout <<= 1;
|
timer->timeout <<= 1;
|
||||||
if ( ( fail = ( timer->timeout > max ) ) )
|
if ( ( fail = ( timer->timeout > max ) ) )
|
||||||
timer->timeout = max;
|
timer->timeout = max;
|
||||||
DBG ( "Timer %p timeout backed off to %ld\n",
|
DBGC ( timer, "Timer %p timeout backed off to %ld\n",
|
||||||
timer, timer->timeout );
|
timer, timer->timeout );
|
||||||
|
|
||||||
/* Call expiry callback */
|
/* Call expiry callback */
|
||||||
timer->expired ( timer, fail );
|
timer->expired ( timer, fail );
|
||||||
|
|
Loading…
Reference in New Issue