MINOR: pass a valid buffer pointer to ha_thread_dump_one()
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Apr 2025 14:48:13 +0000 (16:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 15:04:35 +0000 (17:04 +0200)
commit7931312ff3b93ce69770a73e1d5d1ea0bdbaf26b
tree6a75198fd456db15da98e66566ac429402f87a69
parentf53ed779c979e5338705558e8a0f4d1f8d118473
MINOR: pass a valid buffer pointer to ha_thread_dump_one()

The goal is to let the caller deal with the pointer so that the function
only has to fill that buffer without worrying about locking. This way,
synchronous dumps from "show threads" are produced and emitted directly
without causing undesired locking of the buffer nor risking causing
confusion about thread_dump_buffer containing bits from an interrupted
dump in progress.

It's only the caller that's responsible for notifying the requester of
the end of the dump by setting bit 0 of the pointer if needed (i.e. it's
only done in the debug handler).

(cherry picked from commit b24d7f248e4aeaa154cd9527061c6d98af629c86)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/debug.h
src/debug.c