MINOR: debug: add a new counter type for glitches
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Nov 2024 07:49:38 +0000 (08:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Nov 2024 07:49:38 +0000 (08:49 +0100)
commit502790ed7e76ccf73b481aa110c3e6607b2e75d2
treeec2ae4f120d2e6a031e173fd228d920701a109d1
parente119095290fe6318de53a8dcb6b0eeda90662737
MINOR: debug: add a new counter type for glitches

COUNT_GLITCH() will implement an unconditional counter on its declaration
line when DEBUG_GLITCHES is set, and do nothing otherwise. The output will
be reported as "GLT" and can be filtered as "glt" on the CLI. The purpose
is to help figure what's happening if some glitches counters start going
through the roof. The macro supports an optional string argument to
describe the cause of the glitch (e.g. "truncated header"), which is then
reported in the dump.

For now this is conditioned by DEBUG_GLITCHES but if it turns out to be
light enough, maybe we'll keep it enabled full time. In this case it
might have to be moved away from debug dev, or at least documented (or
done as debug counters maybe so that dev can remain undocumented and
updatable within a branch?).
Makefile
include/haproxy/bug.h
src/debug.c