blob: 47aa41ea0a25af5b02b80aac8e669547cbde4528 [file] [log] [blame]
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -05001#include <watchdog_common.hpp>
2#include <watchdog_logging.hpp>
3
4namespace watchdog
5{
6namespace dump
7{
8
9void 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