b11b5f
From 22eb8fbdab14e5b1b11a4d84c83bef97317e1d2a Mon Sep 17 00:00:00 2001
b11b5f
From: Jan Macku <jamacku@redhat.com>
b11b5f
Date: Thu, 2 Sep 2021 16:37:13 +0200
b11b5f
Subject: [PATCH] core: Add new DBUS properties UnitsReloadStartTimestamp and
b11b5f
 UnitsLoadTimestampMontonic
b11b5f
b11b5f
(cherry picked from commit 49fbe940a429c3d8807bacdfce03af834275257c)
b11b5f
b11b5f
Related: #2136869
b11b5f
---
b11b5f
 src/core/dbus-manager.c | 1 +
b11b5f
 src/core/manager.c      | 2 ++
b11b5f
 src/core/manager.h      | 1 +
b11b5f
 3 files changed, 4 insertions(+)
b11b5f
b11b5f
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
b11b5f
index 5b1ed3646e..8a41eda4a6 100644
b11b5f
--- a/src/core/dbus-manager.c
b11b5f
+++ b/src/core/dbus-manager.c
b11b5f
@@ -2486,6 +2486,7 @@ const sd_bus_vtable bus_manager_vtable[] = {
b11b5f
         BUS_PROPERTY_DUAL_TIMESTAMP("GeneratorsFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_GENERATORS_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST),
b11b5f
         BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_UNITS_LOAD_START]), SD_BUS_VTABLE_PROPERTY_CONST),
b11b5f
         BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_UNITS_LOAD_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST),
b11b5f
+        BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_UNITS_LOAD]), SD_BUS_VTABLE_PROPERTY_CONST),
b11b5f
         SD_BUS_WRITABLE_PROPERTY("LogLevel", "s", property_get_log_level, property_set_log_level, 0, 0),
b11b5f
         SD_BUS_WRITABLE_PROPERTY("LogTarget", "s", property_get_log_target, property_set_log_target, 0, 0),
b11b5f
         SD_BUS_PROPERTY("NNames", "u", property_get_hashmap_size, offsetof(Manager, units), 0),
b11b5f
diff --git a/src/core/manager.c b/src/core/manager.c
b11b5f
index f923cbce37..8aa398cac8 100644
b11b5f
--- a/src/core/manager.c
b11b5f
+++ b/src/core/manager.c
b11b5f
@@ -1580,6 +1580,7 @@ static void manager_preset_all(Manager *m) {
b11b5f
 
b11b5f
 void manager_reloading_start(Manager *m) {
b11b5f
         m->n_reloading++;
b11b5f
+        dual_timestamp_get(m->timestamps + MANAGER_TIMESTAMP_UNITS_LOAD);
b11b5f
 }
b11b5f
 
b11b5f
 int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
b11b5f
@@ -4622,6 +4623,7 @@ static const char *const manager_timestamp_table[_MANAGER_TIMESTAMP_MAX] = {
b11b5f
         [MANAGER_TIMESTAMP_GENERATORS_FINISH] = "generators-finish",
b11b5f
         [MANAGER_TIMESTAMP_UNITS_LOAD_START] = "units-load-start",
b11b5f
         [MANAGER_TIMESTAMP_UNITS_LOAD_FINISH] = "units-load-finish",
b11b5f
+        [MANAGER_TIMESTAMP_UNITS_LOAD]               = "units-load",
b11b5f
 };
b11b5f
 
b11b5f
 DEFINE_STRING_TABLE_LOOKUP(manager_timestamp, ManagerTimestamp);
b11b5f
diff --git a/src/core/manager.h b/src/core/manager.h
b11b5f
index adbbb518cb..98d381bc5b 100644
b11b5f
--- a/src/core/manager.h
b11b5f
+++ b/src/core/manager.h
b11b5f
@@ -67,6 +67,7 @@ typedef enum ManagerTimestamp {
b11b5f
         MANAGER_TIMESTAMP_GENERATORS_FINISH,
b11b5f
         MANAGER_TIMESTAMP_UNITS_LOAD_START,
b11b5f
         MANAGER_TIMESTAMP_UNITS_LOAD_FINISH,
b11b5f
+        MANAGER_TIMESTAMP_UNITS_LOAD,
b11b5f
         _MANAGER_TIMESTAMP_MAX,
b11b5f
         _MANAGER_TIMESTAMP_INVALID = -1,
b11b5f
 } ManagerTimestamp;