]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: trace: don't call strlen() on the thread-id numeric encoding
authorWilly Tarreau <w@1wt.eu>
Thu, 18 Sep 2025 06:02:59 +0000 (08:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Sep 2025 06:02:59 +0000 (08:02 +0200)
commit06fa9f717f4f17e3349ab73d9ac235742ba138be
tree6ea9d9fb9b6b828cd08ba733ab62681f3799ff9b
parentd53ad49ad1713ee874097fff1b4a777141ca2a49
MINOR: trace: don't call strlen() on the thread-id numeric encoding

In __trace(), we're making an integer for the thread id but this one
is passed through strlen() in the call to ist() because it's not a
constant. We do know that it's exactly 3 chars long so we can manage
this using ist2() and pass it the length instead in order to reduce
the number of calls to strlen().

Also let's note that the thread number will no longer be numeric for
thread numbers above 100.
src/trace.c