MINOR: debug: remove unused case of thr!=tid in ha_thread_dump_one()
authorWilly Tarreau <w@1wt.eu>
Thu, 10 Apr 2025 07:03:05 +0000 (09:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 15:04:35 +0000 (17:04 +0200)
commitf53ed779c979e5338705558e8a0f4d1f8d118473
tree1fa907f9f8166c1c1b321d3c064234d5b904a0d8
parent579a0982755eb74d47bfb8c4e93d66115c9bee15
MINOR: debug: remove unused case of thr!=tid in ha_thread_dump_one()

This function was initially designed to dump any threadd into the presented
buffer, but the way it currently works is that it's always called for the
current thread, and uses the distinction between coming from a sighandler
or being called directly to detect which thread is the caller.

Let's simplify all this by replacing thr with tid everywhere, and using
the thread-local pointers where it makes sense (e.g. th_ctx, th_ctx etc).
The confusing "from_signal" argument is now replaced with "is_caller"
which clearly states whether or not the caller declares being the one
asking for the dump (the logic is inverted, but there are only two call
places with a constant).

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