diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2025-07-17 23:36:17 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2025-07-17 23:36:17 +0000 |
commit | e67aef419093b08984b8a2de535bc3e4ce13e087 (patch) | |
tree | 149d24c4c4b99d456406a1ef92b4fda2a95e97eb /lib/Headers | |
parent | 5a846c48f209d04dad36aa35a9968f557c4516f7 (diff) |
stand/ is mostly debugged with printfs, in an ad hoc and sometimes
fragile manner. For example BOOTP_DEBUG in bootp.c cannot be defined
unless NETIF_DEBUG is defined in dev_net.c or build fails for lack of the
symbol debug.
The DEBUG_PRINTF implementation in stand.h addresses that and allows
for more control over debug output. It is compatible with the
usage in libsecureboot.
Simply define _DEBUG_LEVEL to the desired level of debug
or in the case of libsecureboot _DEBUG_LEVEL_VAR to the variable that
will hold that value - default is _debug which is static so each
translation unit can be controlled independently.
The 1st arg to DEBUG_PRINTF is a level which must be greater than or
equal to _DEBUG_LEVEL_VAR if the printf is to be called.
See libsecureboot for more examples.
Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D51269
Diffstat (limited to 'lib/Headers')
0 files changed, 0 insertions, 0 deletions