REORG: sched: move idle time calculation from time.h to task.h
time.h is a horrible place to put activity calculation, it's a
historical mistake because the functions were there. We already have
most of the parts in sched.{c,h} and these ones make an exception in
the middle, forcing time.h to include some thread stuff and to access
the before/after_poll and idle_pct values.
Let's move these 3 functions to task.h with the other ones. They were
prefixed with "sched_" instead of the historical "tv_" which already
made no sense anymore.
diff --git a/src/ev_select.c b/src/ev_select.c
index 12fdaff..12c7341 100644
--- a/src/ev_select.c
+++ b/src/ev_select.c
@@ -18,6 +18,7 @@
#include <haproxy/api.h>
#include <haproxy/fd.h>
#include <haproxy/global.h>
+#include <haproxy/task.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
@@ -172,7 +173,7 @@
delta_ms = wake ? 0 : compute_poll_timeout(exp);
delta.tv_sec = (delta_ms / 1000);
delta.tv_usec = (delta_ms % 1000) * 1000;
- tv_entering_poll();
+ sched_entering_poll();
activity_count_runtime();
status = select(maxfd,
readnotnull ? tmp_evts[DIR_RD] : NULL,
@@ -180,7 +181,7 @@
NULL,
&delta);
tv_update_date(delta_ms, status);
- tv_leaving_poll(delta_ms, status);
+ sched_leaving_poll(delta_ms, status);
thread_harmless_end();
thread_idle_end();