summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch
blob: 309a8c6462db9a973f318aca45a54adb11607fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 46e8e4fe6cb48145152e37380a4064c8957d2ff7 Mon Sep 17 00:00:00 2001
From: Ren Yu <yux.ren@intel.com>
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 <yux.ren@intel.com>
---
 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