From af2fb2f250e664973d947554414749e9b94d68a1 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 8 Mar 2023 12:59:40 +0000 Subject: [PATCH] core: log message when reloading finishes Reloading might be slow, especially when under memory pressure, and watchdogs might be triggered. It is useful to have timestamped telemetry in the journal to see how long a reload takes. --- src/core/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/main.c b/src/core/main.c index 5469c55da7..0bd7937f54 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1973,7 +1973,7 @@ static int invoke_main_loop( manager_send_reloading(m); - log_info("Reloading."); + log_info("Reloading..."); /* First, save any overridden log level/target, then parse the configuration file, * which might change the log level to new settings. */ @@ -1998,6 +1998,9 @@ static int invoke_main_loop( /* Reloading failed before the point of no return. * Let's continue running as if nothing happened. */ m->objective = MANAGER_OK; + else + log_info("Reloading finished in " USEC_FMT " ms.", + usec_sub_unsigned(now(CLOCK_MONOTONIC), m->timestamps[MANAGER_TIMESTAMP_UNITS_LOAD].monotonic) / USEC_PER_MSEC); continue; }