PHAL:createPEL function signature update
Extended createPEL function to support optional additional data.
This is to support new requirement for creating PEL with additional data.
Tested: verified the PEL log.
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: I02f8eea29e40ca65dbdd1631ba0027fbb75a6080
diff --git a/extensions/phal/create_pel.cpp b/extensions/phal/create_pel.cpp
index 379e87e..14d796d 100644
--- a/extensions/phal/create_pel.cpp
+++ b/extensions/phal/create_pel.cpp
@@ -86,11 +86,16 @@
}
}
-void createPEL(const std::string& event)
+void createPEL(const std::string& event, const FFDCData& ffdcData)
{
std::map<std::string, std::string> additionalData;
auto bus = sdbusplus::bus::new_default();
+
additionalData.emplace("_PID", std::to_string(getpid()));
+ for (auto& data : ffdcData)
+ {
+ additionalData.emplace(data);
+ }
try
{
diff --git a/extensions/phal/create_pel.hpp b/extensions/phal/create_pel.hpp
index a582d0e..0081c68 100644
--- a/extensions/phal/create_pel.hpp
+++ b/extensions/phal/create_pel.hpp
@@ -21,11 +21,12 @@
void createBootErrorPEL(const FFDCData& ffdcData, const json& calloutData);
/**
- * @brief Create a PEL for the specified event type
+ * @brief Create a PEL for the specified event type and additional data
*
* @param event - the event type
+ * @param[in] ffdcData - failure data to append to PEL
*/
-void createPEL(const std::string& event);
+void createPEL(const std::string& event, const FFDCData& ffdcData = {});
/**
* @class FFDCFile