BUILD: debug: only dump/reset glitch counters when really defined
authorWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2024 08:31:27 +0000 (09:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Jan 2025 10:20:56 +0000 (11:20 +0100)
commitc8ea4e851e1fa719e6e37863a7f84d8cc83f7c94
treeb7ec0d309dc82c3d32b381fa7c2b4a344f96f0a2
parentab4ff1b7a6c7685f28fbdea01b38caf7e816fddf
BUILD: debug: only dump/reset glitch counters when really defined

If neither DEBUG_GLITCHES nor DEBUG_STRICT is set, we end up with
no dbg_cnt section, resulting in debug_parse_cli_counters not
building due to __stop_dbg_cnt and __start_dbg_cnt not being defined.
Let's just condition the end of the function to these conditions.
An alternate approach (less elegant) is to always declare a dummy
entry of type DBG_COUNTER_TYPES in debug.c.

This must be backported to 3.1 since it was brought with glitches.

(cherry picked from commit 4710ab5604298eefddb36887098d5fc388dcd3cb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/debug.c