MINOR: debug: do not limit backtraces to stuck threads
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 13:14:55 +0000 (15:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 18:04:38 +0000 (19:04 +0100)
commitc984817bb8bdec0635d4d86d31914508780bf8e9
tree4cce4a2cef3b515e685377c3b7c3730de4563736
parent96847724af5c5e3e3d1f3190ac57e69ec95572cc
MINOR: debug: do not limit backtraces to stuck threads

Historically for size limitation reasons, we would only dump the
backtrace of stuck threads. The problem is that when triggering
a panic or other reasons, we have no backtrace, which effectively
limits it to the watchdog timer. It's also visible in "show threads"
which used to report backtraces for all threads in 2.4 and displays
none nowadays, making its use much more limited.

A first approach could be to just dump the thread that triggers the
panic (in addition to stuck threads). But that remains quite limited
since "show threads" would still display nothing. This patch takes a
better approach consisting in dumping all non-idle threads. This way
the output is less polluted that with the older approach (no need to
dump all those waiting in the poller), and all active threads are
visible, in panics as well as in "show threads". As such, the CLI
command "debug dev panic" now dmups backtraces again. This is already
a benefit which will ease testing of various locations against the
ability to resolve useful symbols.

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