]> git.kaiwu.me - haproxy.git/commit
MEDIUM: debug: merge the counter and message emission into complain()
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Aug 2026 11:43:46 +0000 (13:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Aug 2026 15:43:30 +0000 (17:43 +0200)
commit30c03d50f6b49999e69fc7daa868adf0e54b0c81
tree256f7255b6db526af9bbf764a962083ca22a1577
parent2897b2681f2dbf12b04ed36b5d83ffb32972a602
MEDIUM: debug: merge the counter and message emission into complain()

The event counter in debug mode moved to complain_with_dbg(). This
ensures that the deferencing of the counter, the atomic ops, the
condition to skip the emission are all centralized and are no longer
inline in the BUG_ON() location.

The trace emission that was now systematic after calls to complain*()
now moved to the shared _complain(), where it is emitted based on the
elements present in the details passed to the function (fatal/warning).

This saves another 56kB, so we're at -193kB compared to initial work.
The total preprocessor output is now ~7% smaller in bytes than initial
work, and ~10% in words, and builds ~7% faster (7.05s vs 7.55s before
on a 64-core EPYC). The part of the reasonable cleanup is now done.

However the complain_with_dbg function now appears in the caller's
stack as tail jumps are not always done, but we have plans for this.
include/haproxy/bug.h
src/debug.c