]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: log message when reloading finishes
authorLuca Boccassi <bluca@debian.org>
Wed, 8 Mar 2023 12:59:40 +0000 (12:59 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 8 Mar 2023 17:41:07 +0000 (18:41 +0100)
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

index 5469c55da73de509ba9dd3c76168d7dcdcd725f6..0bd7937f54f835fedff6c8a28ecfe5eef7a0fedb 100644 (file)
@@ -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;
                 }