MINOR: tools: resolve main() only once in resolve_sym_name()
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Nov 2024 13:14:49 +0000 (14:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Mar 2025 10:38:00 +0000 (11:38 +0100)
commita4f5771d0390808278f63c074b01465c169a11be
tree67153b8b52787921c9629e77337b9a4d8ababa40
parent69a3563ec82d5d19f3f106274a7df6b96049a594
MINOR: tools: resolve main() only once in resolve_sym_name()

resolv_sym_name() calls dladdr(main) for each symbol in order to compare
the first address with other symbols. But this is pointless and quite
expensive in outputs to "show profiling" for example. Let's just keep a
local copy and have a variable indicating if the resolution is needed/
in progress/done to save the value for subsequent calls.

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