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,8 +76,8 @@ void start_timer_fixed ( struct retry_timer *timer, unsigned long timeout ) {
76 76
 	/* Record timeout */
77 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,8 +126,8 @@ void stop_timer ( struct retry_timer *timer ) {
126 126
 	list_del ( &timer->list );
127 127
 	runtime = ( now - timer->start );
128 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 132
 	/* Update timer.  Variables are:
133 133
 	 *
@@ -150,8 +150,8 @@ void stop_timer ( struct retry_timer *timer ) {
150 150
 		timer->timeout -= ( timer->timeout >> 3 );
151 151
 		timer->timeout += ( runtime >> 1 );
152 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,8 +169,8 @@ static void timer_expired ( struct retry_timer *timer ) {
169 169
 	int fail;
170 170
 
171 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 174
 	assert ( timer->running );
175 175
 	list_del ( &timer->list );
176 176
 	timer->running = 0;
@@ -180,8 +180,8 @@ static void timer_expired ( struct retry_timer *timer ) {
180 180
 	timer->timeout <<= 1;
181 181
 	if ( ( fail = ( timer->timeout > max ) ) )
182 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 186
 	/* Call expiry callback */
187 187
 	timer->expired ( timer, fail );

Loading…
Cancel
Save