]> git.kaiwu.me - haproxy.git/commit
MINOR: debug: add a COUNT() macro which doesn't take a condition
authorWilly Tarreau <w@1wt.eu>
Fri, 6 Nov 2026 15:11:47 +0000 (16:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Nov 2026 15:11:47 +0000 (16:11 +0100)
commit29925e59a7969e266e81a58cd328bde8c5c7d08d
tree74071937225fb8df958650368c72b8bf690d6510
parent023649a0c5dcadc6c6045123981e1a4f57054ad6
MINOR: debug: add a COUNT() macro which doesn't take a condition

Most of the COUNT_IF() calls are placed in locations where they're not
part of a condition, but we just want to count one pass at a specific
location (e.g. branch of an "if" or after a label, etc). In such cases
it's systematically written as COUNT_IF(1, ...), but it's ugly, adds
bytes in the code, and needlessly clobbers the output.

Let's introduce a new variant COUNT() which doesn't require a condition
and only counts the number of passes. This is possible since COUNT_GLITCH
was introduced and already unlocked the ability to write messages without
conditions, so let's just exploit this.
include/haproxy/bug.h