Add event logs for power supply and system power good failures
Tested:
Triggered a timer expiration event for power supply and system
power good events and confirmed that the message correctly shows
in the Redfish event log.
Change-Id: Iaf7e54e57734a5eea1ee0b33a3f804f48ce58278
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/power-control-x86/src/power_control.cpp b/power-control-x86/src/power_control.cpp
index abdc564..07f6a30 100644
--- a/power-control-x86/src/power_control.cpp
+++ b/power-control-x86/src/power_control.cpp
@@ -477,6 +477,24 @@
std::variant<std::string>(getRestartCause(cause)));
}
+static void systemPowerGoodFailedLog()
+{
+ sd_journal_send(
+ "MESSAGE=PowerControl: system power good failed to assert (VR failure)",
+ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s",
+ "OpenBMC.0.1.SystemPowerGoodFailed", "REDFISH_MESSAGE_ARGS=%d",
+ sioPowerGoodWatchdogTimeMs, NULL);
+}
+
+static void psPowerOKFailedLog()
+{
+ sd_journal_send(
+ "MESSAGE=PowerControl: power supply power good failed to assert",
+ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s",
+ "OpenBMC.0.1.PowerSupplyPowerGoodFailed", "REDFISH_MESSAGE_ARGS=%d",
+ psPowerOKWatchdogTimeMs, NULL);
+}
+
static void powerRestorePolicyLog()
{
sd_journal_send("MESSAGE=PowerControl: power restore policy applied",
@@ -1253,6 +1271,7 @@
break;
case Event::psPowerOKWatchdogTimerExpired:
setPowerState(PowerState::failedTransitionToOn);
+ psPowerOKFailedLog();
break;
case Event::sioPowerGoodAssert:
psPowerOKWatchdogTimer.cancel();
@@ -1275,6 +1294,7 @@
break;
case Event::sioPowerGoodWatchdogTimerExpired:
setPowerState(PowerState::failedTransitionToOn);
+ systemPowerGoodFailedLog();
forcePowerOff();
break;
default: