From: Luca Boccassi Date: Fri, 19 Jun 2026 22:49:23 +0000 (+0100) Subject: core: publish shutdown timestamps via D-Bus X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0220732dbac964c3459ab6f9bb5dd976466b40fa;p=thirdparty%2Fsystemd.git core: publish shutdown timestamps via D-Bus --- diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml index e7e56466d2a..abeaaac4381 100644 --- a/man/org.freedesktop.systemd1.xml +++ b/man/org.freedesktop.systemd1.xml @@ -351,6 +351,26 @@ node /org/freedesktop/systemd1 { @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly t ShutdownStartTimestampMonotonic = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t ShutdownFinishTimestamp = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t ShutdownFinishTimestampMonotonic = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownStartTimestamp = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownStartTimestampMonotonic = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownFinishTimestamp = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownFinishTimestampMonotonic = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownLateStartTimestamp = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownLateStartTimestampMonotonic = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownLateFinishTimestamp = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly t PreviousShutdownLateFinishTimestampMonotonic = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly t SecurityStartTimestamp = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly t SecurityStartTimestampMonotonic = ...; @@ -642,6 +662,14 @@ node /org/freedesktop/systemd1 { + + + + + + + + @@ -1076,6 +1104,26 @@ node /org/freedesktop/systemd1 { + + + + + + + + + + + + + + + + + + + + @@ -1878,6 +1926,31 @@ node /org/freedesktop/systemd1 { are always available, depending on the used firmware, boot loader or initrd implementation. In these cases the respective pairs of timestamps are both 0, indicating that no data is available. + ShutdownFinishTimestamp and + ShutdownFinishTimestampMonotonic encode CLOCK_REALTIME and + CLOCK_MONOTONIC microsecond timestamps taken when all units have finished stopping + during shutdown, i.e. when shutdown.target is reached. Together with + ShutdownStartTimestamp (which is taken when unit stopping begins) they bracket the + time spent stopping units. + + PreviousShutdownStartTimestamp, + PreviousShutdownFinishTimestamp, + PreviousShutdownLateStartTimestamp, + PreviousShutdownLateFinishTimestamp and their + Monotonic counterparts encode CLOCK_REALTIME and + CLOCK_MONOTONIC microsecond timestamps describing the shutdown of the + previous boot, restored from the Live Update Orchestrator (LUO) payload after a + kexec-based live update. PreviousShutdownStartTimestamp and + PreviousShutdownFinishTimestamp bracket the unit-stopping phase of that previous + boot, while PreviousShutdownLateStartTimestamp and + PreviousShutdownLateFinishTimestamp are taken by systemd-shutdown + itself when it began execution and when it was about to kexec() into the current + kernel, respectively. Unlike the current cycle's ShutdownStartTimestamp and + ShutdownFinishTimestamp (which describe an in-progress shutdown of the running + system), these always refer to a previous, already-completed boot, similar to the firmware, boot loader + and kernel timestamps. They are populated only after a kexec-based live update and are useful for + determining shutdown and live-update performance; otherwise they are all 0. + UnitsLoadTimestamp and UnitsLoadTimestampMonotonic encode CLOCK_REALTIME and CLOCK_MONOTONIC microseconds timestamps (as described above). The timestamps are taken every time when the manager starts loading unit files. @@ -12823,8 +12896,18 @@ $ gdbus introspect --system --dest org.freedesktop.systemd1 \ ReloadCount, EventLoopRateLimitIntervalUSec, and EventLoopRateLimitBurst were added in version 261. - KExecsCount, and - EnqueueUnitJobMany() were added in version 262. + KExecsCount, + EnqueueUnitJobMany(), + ShutdownFinishTimestamp, + ShutdownFinishTimestampMonotonic, + PreviousShutdownStartTimestamp, + PreviousShutdownStartTimestampMonotonic, + PreviousShutdownFinishTimestamp, + PreviousShutdownFinishTimestampMonotonic, + PreviousShutdownLateStartTimestamp, + PreviousShutdownLateStartTimestampMonotonic, + PreviousShutdownLateFinishTimestamp, and + PreviousShutdownLateFinishTimestampMonotonic were added in version 262. Unit Objects diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 2c4d809329f..4b584038ba9 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -3005,6 +3005,11 @@ const sd_bus_vtable bus_manager_vtable[] = { BUS_PROPERTY_DUAL_TIMESTAMP("UserspaceTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_USERSPACE]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("FinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("ShutdownStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_SHUTDOWN_START]), SD_BUS_VTABLE_PROPERTY_CONST), + BUS_PROPERTY_DUAL_TIMESTAMP("ShutdownFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_SHUTDOWN_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), + BUS_PROPERTY_DUAL_TIMESTAMP("PreviousShutdownStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_PREVIOUS_SHUTDOWN_START]), SD_BUS_VTABLE_PROPERTY_CONST), + BUS_PROPERTY_DUAL_TIMESTAMP("PreviousShutdownFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_PREVIOUS_SHUTDOWN_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), + BUS_PROPERTY_DUAL_TIMESTAMP("PreviousShutdownLateStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_PREVIOUS_SHUTDOWN_LATE_START]), SD_BUS_VTABLE_PROPERTY_CONST), + BUS_PROPERTY_DUAL_TIMESTAMP("PreviousShutdownLateFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_PREVIOUS_SHUTDOWN_LATE_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("SecurityStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_SECURITY_START]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("SecurityFinishTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_SECURITY_FINISH]), SD_BUS_VTABLE_PROPERTY_CONST), BUS_PROPERTY_DUAL_TIMESTAMP("GeneratorsStartTimestamp", offsetof(Manager, timestamps[MANAGER_TIMESTAMP_GENERATORS_START]), SD_BUS_VTABLE_PROPERTY_CONST),