From 46e8e4fe6cb48145152e37380a4064c8957d2ff7 Mon Sep 17 00:00:00 2001 From: Ren Yu Date: Tue, 28 May 2019 17:04:10 +0800 Subject: [PATCH] Add redfish log support for IPMI watchdog pre-timeout interrupt Tested: Config IPMI watchdog: BIOS FRB2 Power Cycle after 1 seconds: ipmitool raw 0x06 0x24 0x01 0x13 0x0 0x2 0xa 0x00 Start watchdog: Ipmitool mc watchdog reset Check the redfish logs in 1 seconds: https://BMCIP/redfish/v1/Systems/system/LogServices/EventLog/Entries Signed-off-by: Ren Yu --- watchdog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/watchdog.cpp b/watchdog.cpp index d893237..5062049 100644 --- a/watchdog.cpp +++ b/watchdog.cpp @@ -104,6 +104,8 @@ uint64_t Watchdog::timeRemaining(uint64_t value) // Optional callback function on timer expiration void Watchdog::timeOutHandler() { + PreTimeoutInterruptAction preTimeoutInterruptAction = preTimeoutInterrupt(); + Action action = expireAction(); if (!this->enabled()) { @@ -117,6 +119,12 @@ void Watchdog::timeOutHandler() "REDFISH_MESSAGE_ARGS=%s", convertForMessage(action).c_str(), NULL); + sd_journal_send("MESSAGE=IPMIWatchdog: Pre Timed out Interrupt=%s", + convertForMessage(preTimeoutInterruptAction).c_str(), + "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s", + "OpenBMC.0.1.IPMIWatchdog", "REDFISH_MESSAGE_ARGS=%s", + convertForMessage(preTimeoutInterruptAction).c_str(), NULL); + expiredTimerUse(currentTimerUse()); auto target = actionTargetMap.find(action); -- 2.7.4