Skip to content

Commit

Permalink
pdr: Add some FFDC for debugging
Browse files Browse the repository at this point in the history
There is a intermittent issue that happens when we fail to send
a repo change event to HB after a PDR exchange and this scenario
is a one-off and is difficult to recreate manually. Adding these
traces will help to improve the FFDC and debugging.

The commit also made some changes to the code which was wrong in
1110 when compared to the 1060 branch.

Change-Id: I00f2226fb6a4f6a3cc2f49cd5aaa0d03230a8602
Signed-off-by: Pavithra Barithaya <[email protected]>
  • Loading branch information
Pavithrab7 committed Sep 25, 2024
1 parent bddfe31 commit f12ceb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 8 additions & 9 deletions host-bmc/host_pdr_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ void HostPDRHandler::fetchPDR(PDRRecordHandles&& recordHandles, uint8_t tid)
pdrRecordHandles.clear();
modifiedPDRRecordHandles.clear();

info("isHostPDRModified flag is set to: {FLAG}", "FLAG", isHostPdrModified);

if (isHostPdrModified)
{
modifiedPDRRecordHandles = std::move(recordHandles);
Expand Down Expand Up @@ -765,6 +767,8 @@ void HostPDRHandler::processHostPDRs(mctp_eid_t /*eid*/,
pldm_pdr_update_TL_pdr(repo, terminusHandle, tid, tlEid,
tlValid);

info("the responseReceived flag is set to : {RR}", "RR",
responseReceived);
if (!isHostUp())
{
// The terminus PDR becomes invalid when the terminus
Expand Down Expand Up @@ -832,15 +836,6 @@ void HostPDRHandler::processHostPDRs(mctp_eid_t /*eid*/,
"Failed to add PDR when isHostPdrModified is not true");
}
}
else
{
rc = pldm_pdr_add_check(repo, pdr.data(), respCount,
true, pdrTerminusHandle, &rh);
if (rc)
{
throw std::runtime_error("Failed to add PDR");
}
}
}
}
}
Expand Down Expand Up @@ -884,6 +879,7 @@ void HostPDRHandler::processHostPDRs(mctp_eid_t /*eid*/,
entityAssociations.clear();

mergedHostParents = false;
info("the merged flag is set to : {MERGED}", "MERGED", merged);

if (merged)
{
Expand Down Expand Up @@ -922,6 +918,9 @@ void HostPDRHandler::_processPDRRepoChgEvent(
oemPlatformHandler->updateContainerID();
}
deferredPDRRepoChgEvent.reset();
info(
"Before sending repo change event the isHostPDRModified is set to: {FLAG}",
"FLAG", isHostPdrModified);
this->sendPDRRepositoryChgEvent(
std::move(std::vector<uint8_t>(1, PLDM_PDR_ENTITY_ASSOCIATION)),
FORMAT_IS_PDR_HANDLES);
Expand Down
3 changes: 3 additions & 0 deletions libpldmresponder/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ int Handler::pldmPDRRepositoryChgEvent(const pldm_msg* request,
info(
"Got a records added/modified event from tid '{TID}' eventDataOperation is {ED}",
"TID", tid, "ED", eventDataOperation);
info(
"isHostPDRModified flag before we start fetching PDRs is set to: {FLAG}",
"FLAG", hostPDRHandler->isHostPdrModified);
hostPDRHandler->fetchPDR(std::move(pdrRecordHandles), tid);
}
}
Expand Down

0 comments on commit f12ceb2

Please sign in to comment.