watchdog: Create PEL when AutoReboot is false and watchdog times out
Testing brought to light that an error should always be logged
when the host watchdog times out
Testing:
Excecuted watchdog_timeout command manually after setting AutoReboot
property to false, and used peltool to verify the PEL was created.
Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com>
Change-Id: I8e92676021dd4243d51daca567d8dccc6c56fa7d
diff --git a/watchdog/watchdog_logging.cpp b/watchdog/watchdog_logging.cpp
index 7d5bdd9..52ec7c7 100644
--- a/watchdog/watchdog_logging.cpp
+++ b/watchdog/watchdog_logging.cpp
@@ -1,5 +1,6 @@
#include <unistd.h>
+#include <watchdog_common.hpp>
#include <watchdog_dbus.hpp>
#include <watchdog_handler.hpp>
#include <watchdog_logging.hpp>
@@ -27,7 +28,11 @@
// Create PEL with additional data.
auto pelId = createPel(eventName, additional, emptyFfdc);
- requestDump(pelId, timeout); // will not return until dump is complete
+ // Collect Hostboot dump if auto reboot is enabled
+ if (isAutoRebootEnabled())
+ {
+ requestDump(pelId, timeout); // will not return until dump is complete
+ }
}
void eventWatchdogTimeout(const uint32_t timeout)
diff --git a/watchdog/watchdog_main.cpp b/watchdog/watchdog_main.cpp
index 47aa41e..f503674 100644
--- a/watchdog/watchdog_main.cpp
+++ b/watchdog/watchdog_main.cpp
@@ -15,11 +15,7 @@
// Put system into diagnostic mode
transitionHost(HOST_STATE_DIAGNOSTIC_MODE);
- // Collect Hostboot dump if auto reboot is enabled
- if (isAutoRebootEnabled())
- {
- eventWatchdogTimeout(timeout);
- }
+ eventWatchdogTimeout(timeout);
// Put system into quiesce state
transitionHost(HOST_STATE_QUIESCE_TGT);