Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 1 | #include <watchdog_common.hpp> |
| 2 | #include <watchdog_logging.hpp> |
| 3 | |
| 4 | namespace watchdog |
| 5 | { |
| 6 | namespace dump |
| 7 | { |
| 8 | |
| 9 | void triggerHostbootDump(const uint32_t timeout) |
| 10 | { |
| 11 | constexpr auto HOST_STATE_DIAGNOSTIC_MODE = |
| 12 | "obmc-host-diagnostic-mode@0.target"; |
| 13 | constexpr auto HOST_STATE_QUIESCE_TGT = "obmc-host-quiesce@0.target"; |
| 14 | |
| 15 | // Put system into diagnostic mode |
| 16 | transitionHost(HOST_STATE_DIAGNOSTIC_MODE); |
| 17 | |
| 18 | // Collect Hostboot dump if auto reboot is enabled |
| 19 | if (isAutoRebootEnabled()) |
| 20 | { |
| 21 | eventWatchdogTimeout(timeout); |
| 22 | } |
| 23 | |
| 24 | // Put system into quiesce state |
| 25 | transitionHost(HOST_STATE_QUIESCE_TGT); |
| 26 | } |
| 27 | |
| 28 | } // namespace dump |
| 29 | } // namespace watchdog |