]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: add two new macros to enable debugging in hot paths
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Feb 2022 14:25:58 +0000 (15:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Feb 2022 14:32:24 +0000 (15:32 +0100)
commit7bd7954535c9ea1ebc6719723102db3eaeeaefa7
tree78646cc22b5e853649b3d8c986cee1492d712d18
parent86bcc53084fb06351353add8881ff4b789ca08cd
DEBUG: add two new macros to enable debugging in hot paths

Two new BUG_ON variants, BUG_ON_HOT() and CHECK_IF_HOT() are introduced
to debug hot paths (such as low-level API functions). These ones must
not be enabled by default as they would significantly affect performance
but they may be enabled by setting DEBUG_STRICT to a value above 1. In
this case, DEBUG_STRICT_ACTION is mostly respected with a small change,
which is that the no_crash variant of BUG_ON() isn't turned to a regular
warning but to a one-time warning so as not to spam with warnings in a
hot path. It is for this reason that there is no WARN_ON_HOT().
include/haproxy/bug.h