PEL: Update system info into HB PEL extended user data section
Hostboot requested BMC add a UserData section containing debug
information like internal code level name and the bmc/host/chassis
states that are added to the BMC PELs. To accomodate this BMC code will
look in incoming PELs for an ED section with specific
compID/version/subtype fields, and then modify it with the appropriate
debug contents as mentioned above.
Test: Verified PEL tool output by injecting error to generate
hostboot PEL
Signed-off-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Change-Id: I72288089f2768412eb9033b121e7f02f72f11fc7
diff --git a/extensions/openpower-pels/pel.cpp b/extensions/openpower-pels/pel.cpp
index 48dff51..a3314cd 100644
--- a/extensions/openpower-pels/pel.cpp
+++ b/extensions/openpower-pels/pel.cpp
@@ -493,6 +493,47 @@
return calloutPresent;
}
+void PEL::updateSysInfoInExtendedUserDataSection(
+ const DataInterfaceBase& dataIface)
+{
+ const AdditionalData additionalData;
+
+ // Check for PEL from Hostboot
+ if (_ph->creatorID() == static_cast<uint8_t>(CreatorID::hostboot))
+ {
+ // Get the ED section from PEL
+ auto op = std::find_if(_optionalSections.begin(),
+ _optionalSections.end(), [](auto& section) {
+ return section->header().id ==
+ static_cast<uint16_t>(
+ SectionID::extUserData);
+ });
+
+ // Check for ED section found and its not the last section of PEL
+ if (op != _optionalSections.end())
+ {
+ // Get the extended user data class mapped to found section
+ auto extUserData = static_cast<ExtendedUserData*>(op->get());
+
+ // Check for the creator ID is for OpenBMC
+ if (extUserData->creatorID() ==
+ static_cast<uint8_t>(CreatorID::openBMC))
+ {
+ // Update subtype and component id
+ auto subType = static_cast<uint8_t>(UserDataFormat::json);
+ auto componentId =
+ static_cast<uint16_t>(ComponentID::phosphorLogging);
+
+ // Update system data to ED section
+ auto ud =
+ util::makeSysInfoUserDataSection(additionalData, dataIface);
+ extUserData->updateDataSection(subType, componentId,
+ ud->data());
+ }
+ }
+ }
+}
+
namespace util
{
@@ -554,7 +595,10 @@
{
}
- json["Process Name"] = std::move(name);
+ if (pid)
+ {
+ json["Process Name"] = std::move(name);
+ }
}
void addBMCFWVersionIDToJSON(nlohmann::json& json,