1 #include <attn/attention.hpp> 2 #include <attn/attn_common.hpp> 3 #include <attn/attn_dump.hpp> 4 #include <attn/attn_logging.hpp> 5 #include <sdbusplus/bus.hpp> 6 #include <util/dbus.hpp> 7 #include <util/trace.hpp> 8 9 namespace attn 10 { 11 12 /** 13 * @brief Handle SBE vital attention 14 * 15 * @param i_attention Attention object 16 * @return 0 indicates that the vital attention was successfully handled 17 * 1 indicates that the vital attention was NOT successfully handled 18 */ 19 int handleVital(Attention* i_attention) 20 { 21 int rc = RC_SUCCESS; // assume vital handled 22 23 trace::inf("vital handler started"); 24 25 // if vital handling enabled, handle vital attention 26 if (false == (i_attention->getConfig()->getFlag(enVital))) 27 { 28 trace::inf("vital handling disabled"); 29 rc = RC_NOT_HANDLED; 30 } 31 else 32 { 33 // wait for power fault handling before starting analyses 34 sleepSeconds(POWER_FAULT_WAIT); 35 36 // generate pel 37 auto pelId = eventVital(); 38 39 // conditionally request dump 40 if ((0 != pelId) && (util::dbus::HostRunningState::NotStarted == 41 util::dbus::hostRunningState())) 42 { 43 requestDump(pelId, DumpParameters{0, DumpType::SBE}); 44 } 45 46 // transition host 47 util::dbus::transitionHost(util::dbus::HostState::Quiesce); 48 } 49 50 return rc; 51 } 52 53 } // namespace attn 54