PEL: move libekb init function to sbe ffdc init
libekb init should run only after pdbg initialisation.
Tested: created sbe error and validated.
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: I8fe2b9ccff61e42aa0e6b0fd7bc6c85a295edd3e
diff --git a/extensions/openpower-pels/entry_points.cpp b/extensions/openpower-pels/entry_points.cpp
index 81ce3f8..da3073b 100644
--- a/extensions/openpower-pels/entry_points.cpp
+++ b/extensions/openpower-pels/entry_points.cpp
@@ -24,10 +24,6 @@
#include <phosphor-logging/log.hpp>
-#ifdef SBE_FFDC_SUPPORTED
-#include <libekb.H>
-#endif
-
namespace openpower
{
namespace pels
@@ -73,12 +69,6 @@
fmt::format("Failed to set PDBG_DTB: ({})", strerror(errno))
.c_str());
}
-
- if (libekb_init())
- {
- log<level::ERR>("libekb_init failed");
- throw std::runtime_error("libekb initialization failed");
- }
#endif
}
diff --git a/extensions/openpower-pels/sbe_ffdc_handler.cpp b/extensions/openpower-pels/sbe_ffdc_handler.cpp
index af445c3..4415028 100644
--- a/extensions/openpower-pels/sbe_ffdc_handler.cpp
+++ b/extensions/openpower-pels/sbe_ffdc_handler.cpp
@@ -25,6 +25,7 @@
#include <ekb/hwpf/fapi2/include/return_code_defs.H>
#include <fmt/format.h>
+#include <libekb.H>
#include <new>
#include <phosphor-logging/log.hpp>
@@ -167,6 +168,12 @@
return;
}
+ if (libekb_init())
+ {
+ log<level::ERR>("libekb_init failed, skipping ffdc processing");
+ return;
+ }
+
try
{
// libekb provided wrapper function to convert SBE FFDC