From: Maria Matejka Date: Tue, 4 Jun 2024 08:10:35 +0000 (+0200) Subject: Softened warning about too much time spent in loop X-Git-Tag: v3.0.0~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=423eaf34388e9e567754d1e2dbecd72a7c6cddb6;p=thirdparty%2Fbird.git Softened warning about too much time spent in loop Now the warning needs at least 10 ms after the scheduled end time to ever complain. TODO: make this configurable --- diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 96b67e22a..ad4bbbe26 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -152,7 +152,7 @@ static _Thread_local uint birdloop_wakeup_masked_count; #define LOOP_TRACE(loop, fmt, args...) do { if (config && config->latency_debug) log(L_TRACE "%s (%p): " fmt, LOOP_NAME(loop), (loop), ##args); } while (0) #define THREAD_TRACE(...) do { if (config && config->latency_debug) log(L_TRACE "Thread: " __VA_ARGS__); } while (0) -#define LOOP_WARN(loop, fmt, args...) log(L_TRACE "%s (%p): " fmt, LOOP_NAME(loop), (loop), ##args) +#define LOOP_WARN(loop, fmt, args...) log(L_WARN "%s (%p): " fmt, LOOP_NAME(loop), (loop), ##args) event_list * @@ -1465,8 +1465,8 @@ birdloop_run(void *_loop) /* Now we can actually do some work */ u64 dif = account_to(&loop->working); - if (dif > this_thread->max_loop_time_ns) - LOOP_WARN(loop, "locked %lu ns after its scheduled end time", dif); + if (dif > this_thread->max_loop_time_ns + config->latency_limit TO_NS) + LOOP_WARN(loop, "locked %lu us after its scheduled end time", dif NS TO_US); uint repeat, loop_runs = 0; do {