oem-ibm: FFDC enhancement changes
Added fine tuned first failure data capture traces in the system
and resource dump related paths.
Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com>
Change-Id: I484853eb1fa79e166daa87dd374966d94faa36f6
diff --git a/oem/ibm/libpldmresponder/file_io.cpp b/oem/ibm/libpldmresponder/file_io.cpp
index 4fee024..b347960 100644
--- a/oem/ibm/libpldmresponder/file_io.cpp
+++ b/oem/ibm/libpldmresponder/file_io.cpp
@@ -27,12 +27,10 @@
namespace responder
{
-
namespace fs = std::filesystem;
namespace dma
{
-
/** @struct AspeedXdmaOp
*
* Structure representing XDMA operation
@@ -70,7 +68,9 @@
if (dmaFd < 0)
{
rc = -errno;
- std::cerr << "Failed to open the XDMA device, RC=" << rc << "\n";
+ std::cerr << "transferHostDataToSocket: Failed to open the XDMA device,"
+ " RC="
+ << rc << "\n";
return rc;
}
@@ -82,7 +82,9 @@
if (MAP_FAILED == vgaMem)
{
rc = -errno;
- std::cerr << "Failed to mmap the XDMA device, RC=" << rc << "\n";
+ std::cerr << "transferHostDataToSocket: Failed to mmap the XDMA device,"
+ " RC="
+ << rc << "\n";
return rc;
}
@@ -97,8 +99,10 @@
if (rc < 0)
{
rc = -errno;
- std::cerr << "Failed to execute the DMA operation, RC=" << rc
- << " ADDRESS=" << address << " LENGTH=" << length << "\n";
+ std::cerr << "transferHostDataToSocket: Failed to execute the DMA "
+ "operation, RC="
+ << rc << " ADDRESS=" << address << " LENGTH=" << length
+ << "\n";
return rc;
}
@@ -108,7 +112,9 @@
{
rc = -errno;
close(fd);
- std::cerr << "closing socket" << std::endl;
+ std::cerr << "transferHostDataToSocket: Closing socket as "
+ "writeToUnixSocket faile with RC="
+ << rc << std::endl;
return rc;
}
return 0;
@@ -135,7 +141,8 @@
else
{
std::cerr
- << "Received interrupt during DMA transfer. Skipping Unmap"
+ << "transferDataHost: Received interrupt during DMA transfer."
+ " Skipping Unmap."
<< std::endl;
}
};
@@ -145,7 +152,8 @@
if (dmaFd < 0)
{
rc = -errno;
- std::cerr << "Failed to open the XDMA device, RC=" << rc << "\n";
+ std::cerr << "transferDataHost: Failed to open the XDMA device, RC="
+ << rc << "\n";
return rc;
}
@@ -157,7 +165,8 @@
if (MAP_FAILED == vgaMem)
{
rc = -errno;
- std::cerr << "Failed to mmap the XDMA device, RC=" << rc << "\n";
+ std::cerr << "transferDataHost: Failed to mmap the XDMA device, RC="
+ << rc << "\n";
return rc;
}
@@ -168,9 +177,9 @@
rc = lseek(fd, offset, SEEK_SET);
if (rc == -1)
{
- std::cerr << "lseek failed, ERROR=" << errno
- << ", UPSTREAM=" << upstream << ", OFFSET=" << offset
- << "\n";
+ std::cerr << "transferDataHost upstream: lseek failed, ERROR="
+ << errno << ", UPSTREAM=" << upstream
+ << ", OFFSET=" << offset << "\n";
return rc;
}
@@ -182,16 +191,16 @@
rc = read(fd, buffer.data(), length);
if (rc == -1)
{
- std::cerr << "file read failed, ERROR=" << errno
- << ", UPSTREAM=" << upstream << ", LENGTH=" << length
- << ", OFFSET=" << offset << "\n";
+ std::cerr << "transferDataHost upstream: file read failed, ERROR="
+ << errno << ", UPSTREAM=" << upstream
+ << ", LENGTH=" << length << ", OFFSET=" << offset << "\n";
return rc;
}
if (rc != static_cast<int>(length))
{
- std::cerr << "mismatch between number of characters to read and "
- << "the length read, LENGTH=" << length << " COUNT=" << rc
- << "\n";
+ std::cerr << "transferDataHost upstream: mismatch between number of"
+ << "characters to read and the length read, LENGTH="
+ << length << " COUNT=" << rc << "\n";
return -1;
}
memcpy(static_cast<char*>(vgaMemPtr.get()), buffer.data(),
@@ -207,8 +216,9 @@
if (rc < 0)
{
rc = -errno;
- std::cerr << "Failed to execute the DMA operation, RC=" << rc
- << " UPSTREAM=" << upstream << " ADDRESS=" << address
+ std::cerr << "transferDataHost: Failed to execute the DMA operation,"
+ " RC="
+ << rc << " UPSTREAM=" << upstream << " ADDRESS=" << address
<< " LENGTH=" << length << "\n";
return rc;
}
@@ -218,17 +228,18 @@
rc = lseek(fd, offset, SEEK_SET);
if (rc == -1)
{
- std::cerr << "lseek failed, ERROR=" << errno
- << ", UPSTREAM=" << upstream << ", OFFSET=" << offset
- << "\n";
+ std::cerr << "transferDataHost downstream: lseek failed, ERROR="
+ << errno << ", UPSTREAM=" << upstream
+ << ", OFFSET=" << offset << "\n";
return rc;
}
rc = write(fd, static_cast<const char*>(vgaMemPtr.get()), length);
if (rc == -1)
{
- std::cerr << "file write failed, ERROR=" << errno
- << ", UPSTREAM=" << upstream << ", LENGTH=" << length
- << ", OFFSET=" << offset << "\n";
+ std::cerr << "transferDataHost downstream: file write failed,"
+ " ERROR="
+ << errno << ", UPSTREAM=" << upstream
+ << ", LENGTH=" << length << ", OFFSET=" << offset << "\n";
return rc;
}
}
@@ -240,7 +251,6 @@
namespace oem_ibm
{
-
Response Handler::readFileIntoMemory(const pldm_msg* request,
size_t payloadLength)
{