Extend the DEBUG=... syntax to allow debug messages to be compiled in but disabled by default. For example: make bin/undionly.kpxe DEBUG=netdevice:3:1 would compile in the messages as for DEBUG=netdevice:3, but would set the debug level mask so that only the DEBUG=netdevice:1 messages would be displayed. This allows for external code to selectively enable the additional debug messages at runtime, without being overwhelmed by unwanted initial noise. For example, a developer of a new protocol may want to temporarily enable tracing of all packets received: this can be done by building with DEBUG=netdevice:3:1 and using // temporarily enable per-packet messages DBG_ENABLE_OBJECT ( netdevice, DBGLVL_EXTRA ); ... // disable per-packet messages DBG_DISABLE_OBJECT ( netdevice, DBGLVL_EXTRA ); Note that unlike the usual DBG_ENABLE() and DBG_DISABLE() macros, DBG_ENABLE_OBJECT() and DBG_DISABLE_OBJECT() will not be removed via dead code elimination if debugging is disabled in the specified object. In particular, this means that using either of these macros will always result in a symbol reference to the specified object. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
523 |
|
523 |
|
524 |
|
524 |
|
525 |
|
525 |
|
|
526 |
|
|
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
|
530 |
|
|
|
531 |
|
|
526 |
|
532 |
|
527 |
|
533 |
|
528 |
|
534 |
|
529 |
|
535 |
|
530 |
|
536 |
|
531 |
|
|
|
|
537 |
|
|
532 |
|
538 |
|
533 |
|
539 |
|
534 |
|
540 |
|
535 |
|
541 |
|
536 |
|
542 |
|
537 |
|
543 |
|
538 |
|
|
|
|
544 |
|
|
539 |
|
545 |
|
540 |
|
546 |
|
541 |
|
547 |
|
|
|
||
1019 |
|
1025 |
|
1020 |
|
1026 |
|
1021 |
|
1027 |
|
1022 |
|
|
|
1023 |
|
|
|
1024 |
|
|
|
1025 |
|
|
|
|
1028 |
|
|
|
1029 |
|
|
|
1030 |
|
|
|
1031 |
|
|
|
1032 |
|
|
|
1033 |
|
|
1026 |
|
1034 |
|
1027 |
|
1035 |
|
1028 |
|
1036 |
|
|
|
||
270 |
|
270 |
|
271 |
|
271 |
|
272 |
|
272 |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
|
|
|
276 |
|
|
273 |
|
277 |
|
274 |
|
278 |
|
275 |
|
279 |
|
|
|
||
286 |
|
290 |
|
287 |
|
291 |
|
288 |
|
292 |
|
289 |
|
|
|
|
293 |
|
|
290 |
|
294 |
|
291 |
|
295 |
|
292 |
|
296 |
|