gen: Add suffixed OSStatus service per-host paths
In multi-host configurations, power-control registers the per-host
OperatingSystem status service as
xyz.openbmc_project.State.OperatingSystem{idx} and exposes the
OperatingSystemState property on either
/xyz/openbmc_project/state/host{idx} or
/xyz/openbmc_project/state/os{idx} depending on platform configuration.
Previously, GenPSMConfig only paired the un-suffixed service name with
/xyz/openbmc_project/state/host{idx} and the suffixed service name with
/xyz/openbmc_project/state/os. Add the suffixed service name with both
/xyz/openbmc_project/state/host{idx} and
/xyz/openbmc_project/state/os{idx} so OSStatus:Inactive,
OSStatus:Standby, and the Firmware stage duration are properly recorded
across multi-host systems.
Tested:
Verified on multi-host systems (both /state/host{idx} and /state/os{idx}
configurations) across functional checkpoint injection,
ComputerSystem.Reset (PowerCycle and ForceRestart), and Chassis.Reset
(TrayPowerCycle):
Full test logs:
https://paste.googleplex.com/6755399435824681?raw
https://paste.googleplex.com/6755399435854201?raw
1. D-Bus & Service Logs:
boot-time-monitor: SetNodeCheckpoint 'HostState:Off' for host0
boot-time-monitor: SetNodeCheckpoint 'OSStatus:Inactive' for host0
boot-time-monitor: SetNodeCheckpoint 'HostState:Off' for host1
boot-time-monitor: SetNodeCheckpoint 'OSStatus:Inactive' for host1
boot-time-monitor: SetNodeCheckpoint 'HostState:Running' for host1
boot-time-monitor: SetNodeCheckpoint 'HostState:Running' for host0
boot-time-monitor: SetNodeCheckpoint 'OSStatus:Standby' for host1
boot-time-monitor: SetNodeCheckpoint 'OSStatus:Standby' for host0
2. Redfish ComputerSystem.Reset (/redfish/v1/Systems/system{1,2}/Oem/Google/BootTime):
- Config A (/state/host{1,2}, system1):
"Breakdown": [
{"Duration": 247.65, "Stage": "Firmware"},
{"Duration": 7.887, "Stage": "Kernel"},
{"Duration": 23.698, "Stage": "Off"},
{"Duration": 0.0, "Stage": "RebootEnd"},
{"Duration": 96.162, "Stage": "TransitioningToKernel"},
{"Duration": 101.201, "Stage": "Userspace"}
]
"Stat": {"IsRebooting": false, "PowerSource": "AC"}, "Total": 476.598
- Config B (/state/os{1,2}, system1 & system2):
- system1: Firmware: 296.35, Kernel: 26.717, Off: 235.936,
TransitioningToKernel: 208.725, Userspace: 197.858, Total: 965.596
- system2: Firmware: 589.63, Kernel: 25.623, Off: 240.255,
TransitioningToKernel: 209.46, Userspace: 217.957, Total: 1282.935
3. Redfish TrayPowerCycle (/redfish/v1/Managers/bmc/Oem/Google/BootTime
& /redfish/v1/Systems/system{1,2}/Oem/Google/BootTime):
- BMC: RebootStart -> TrayPowerCycle -> UserspaceEnd -> RebootEnd
(IsRebooting: false, PowerSource: "AC", Total: 177.319 / 215.535)
- system1 & system2: HostState:Off -> OSStatus:Inactive ->
TrayPowerCycle -> HostState:Off -> HostState:Running ->
OSStatus:Standby -> Userspace:BEGIN -> Userspace -> RebootEnd
Google-Bug-Id: 399792269
Change-Id: Id1a29dc128a8830972f2d5100b07311246daa14e
Signed-off-by: Munawar Hussain <munawarhussain@google.com>
diff --git a/.clang-tidy b/.clang-tidy
index 68454d8..a1df213 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,4 +1,6 @@
-Checks: ''
+Checks: '-*
+ '
+
+HeaderFilterRegex: (?!\.pb\.h$)|(?!^xyz/)
WarningsAsErrors: '*'
-HeaderFilterRegex: '(?!\.pb\.h$)|(?!^xyz/)'
\ No newline at end of file
diff --git a/include/gen.hpp b/include/gen.hpp
index 4332960..003ead8 100644
--- a/include/gen.hpp
+++ b/include/gen.hpp
@@ -39,6 +39,10 @@
// New multi host nodes style.
{"xyz.openbmc_project.State.OperatingSystem",
fmt::format("/xyz/openbmc_project/state/host{}", idx)},
+ {fmt::format("xyz.openbmc_project.State.OperatingSystem{}", idx),
+ fmt::format("/xyz/openbmc_project/state/host{}", idx)},
+ {fmt::format("xyz.openbmc_project.State.OperatingSystem{}", idx),
+ fmt::format("/xyz/openbmc_project/state/os{}", idx)},
// Old multi host nodes style.
{fmt::format("xyz.openbmc_project.State.OperatingSystem{}", idx),
"/xyz/openbmc_project/state/os"},