]> git.kaiwu.me - haproxy.git/commit
MINOR: task: move the profiling checks to the called functions not callers
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Jun 2026 14:45:13 +0000 (16:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Jun 2026 16:01:33 +0000 (18:01 +0200)
commit5fd3c8bf70a98cf62d1a0d899b9d9d657efc9a60
treefbe733ac15cf37f186cdf6a4c2510ab349254739
parent9ec82560f24a24245e865df6a2650b5dfd44c986
MINOR: task: move the profiling checks to the called functions not callers

The checks on TH_FL_TASK_PROFILING that are used to decide whether or not
to set t->wake_date from now_mono_time() used to be made in callers of
__tasklet_wakeup_on() and __tasklet_wakeup_after(), but not only this
needlessly inflates code by placing this in every caller (~4kB), it also
renders the design fragile since each caller needs to blindly copy-paste
that statement.

Let's move the operation in the callees instead. As a bonus, it allows
to check the flag on the target thread and not on the calling thread
(which was arguably a bug though without a noticeable effect since for
now profiling is for all threads or none).
include/haproxy/task.h
src/task.c