Browse Source

[retry] Colourise debug output

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
93b4586447
1 changed files with 10 additions and 10 deletions
  1. 10
    10
      src/net/retry.c

+ 10
- 10
src/net/retry.c View File

76
 	/* Record timeout */
76
 	/* Record timeout */
77
 	timer->timeout = timeout;
77
 	timer->timeout = timeout;
78
 
78
 
79
-	DBG2 ( "Timer %p started at time %ld (expires at %ld)\n",
80
-	       timer, timer->start, ( timer->start + timer->timeout ) );
79
+	DBGC2 ( timer, "Timer %p started at time %ld (expires at %ld)\n",
80
+		timer, timer->start, ( timer->start + timer->timeout ) );
81
 }
81
 }
82
 
82
 
83
 /**
83
 /**
126
 	list_del ( &timer->list );
126
 	list_del ( &timer->list );
127
 	runtime = ( now - timer->start );
127
 	runtime = ( now - timer->start );
128
 	timer->running = 0;
128
 	timer->running = 0;
129
-	DBG2 ( "Timer %p stopped at time %ld (ran for %ld)\n",
130
-	       timer, now, runtime );
129
+	DBGC2 ( timer, "Timer %p stopped at time %ld (ran for %ld)\n",
130
+		timer, now, runtime );
131
 
131
 
132
 	/* Update timer.  Variables are:
132
 	/* Update timer.  Variables are:
133
 	 *
133
 	 *
150
 		timer->timeout -= ( timer->timeout >> 3 );
150
 		timer->timeout -= ( timer->timeout >> 3 );
151
 		timer->timeout += ( runtime >> 1 );
151
 		timer->timeout += ( runtime >> 1 );
152
 		if ( timer->timeout != old_timeout ) {
152
 		if ( timer->timeout != old_timeout ) {
153
-			DBG ( "Timer %p timeout updated to %ld\n",
154
-			      timer, timer->timeout );
153
+			DBGC ( timer, "Timer %p timeout updated to %ld\n",
154
+			       timer, timer->timeout );
155
 		}
155
 		}
156
 	}
156
 	}
157
 
157
 
169
 	int fail;
169
 	int fail;
170
 
170
 
171
 	/* Stop timer without performing RTT calculations */
171
 	/* Stop timer without performing RTT calculations */
172
-	DBG2 ( "Timer %p stopped at time %ld on expiry\n",
173
-	       timer, currticks() );
172
+	DBGC2 ( timer, "Timer %p stopped at time %ld on expiry\n",
173
+		timer, currticks() );
174
 	assert ( timer->running );
174
 	assert ( timer->running );
175
 	list_del ( &timer->list );
175
 	list_del ( &timer->list );
176
 	timer->running = 0;
176
 	timer->running = 0;
180
 	timer->timeout <<= 1;
180
 	timer->timeout <<= 1;
181
 	if ( ( fail = ( timer->timeout > max ) ) )
181
 	if ( ( fail = ( timer->timeout > max ) ) )
182
 		timer->timeout = max;
182
 		timer->timeout = max;
183
-	DBG ( "Timer %p timeout backed off to %ld\n",
184
-	      timer, timer->timeout );
183
+	DBGC ( timer, "Timer %p timeout backed off to %ld\n",
184
+	       timer, timer->timeout );
185
 
185
 
186
 	/* Call expiry callback */
186
 	/* Call expiry callback */
187
 	timer->expired ( timer, fail );
187
 	timer->expired ( timer, fail );

Loading…
Cancel
Save