summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2012-04-25 15:48:55 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-07 12:40:36 -0500
commite959276ad0504352a59fbe92013bde06517bc5da (patch)
tree9ccbe299ef830194ee97d4d5285cf0b38f88db90 /src/include
parent39ce3d8ecf06c4c04d245a6107daa73611767c5f (diff)
downloadtalos-hostboot-e959276ad0504352a59fbe92013bde06517bc5da.tar.gz
talos-hostboot-e959276ad0504352a59fbe92013bde06517bc5da.zip
Coalesce ERRL user detail data error log sections
Add optional 'merge' flag to addFFDC() method which certain UserDetail error log objects will use to cause additional log entries to get merged together. They will ONLY get merged if they match with the last section added, to preserve error log order. In addition, add support for an addData() method on the Attributes User Detail class. And re-organize code so that constructor methods are smaller, making final library smaller. NOTE - the parse() functions are NOT complete, since building and executing the hb errlparser tool is currently broken. Story 41707 is open to do that work once the tool builds. Change-Id: I04d85620efe964ac243dd76df78ad4161e5a2f13 RTC: 41534 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1050 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/errl/errlentry.H7
-rw-r--r--src/include/usr/errl/errlsctnhdr.H1
-rw-r--r--src/include/usr/errl/errludstring.H9
-rw-r--r--src/include/usr/errl/errludtarget.H16
-rwxr-xr-xsrc/include/usr/errl/errluserdetails.H5
5 files changed, 28 insertions, 10 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index de63212a1..32f9c2fe7 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -295,6 +295,10 @@ public:
* which classifies the data. This in
* conjunction with the version can be used
* to decode the data.
+ * @param[in] i_merge A boolean value (defaults to false if
+ * parameter is not specified) to indicate
+ * whether this buffer is merged with the
+ * previous section iff it matches.
*
* @return Pointer to FFDC section if successfully added.
* NULL if fails
@@ -303,7 +307,8 @@ public:
const void * i_dataPtr,
const uint32_t i_ffdcLen,
const uint8_t i_ffdcVer,
- const uint8_t i_ffdcSubSect);
+ const uint8_t i_ffdcSubSect,
+ bool i_merge = false);
/**
* @brief Append more data to an FFDC section.
diff --git a/src/include/usr/errl/errlsctnhdr.H b/src/include/usr/errl/errlsctnhdr.H
index 598b19150..870c101ed 100644
--- a/src/include/usr/errl/errlsctnhdr.H
+++ b/src/include/usr/errl/errlsctnhdr.H
@@ -60,6 +60,7 @@ class ErrlSctnHdr
friend class ErrlUH;
friend class ErrlUD;
friend class ErrlSrc;
+ friend class ErrlEntry;
diff --git a/src/include/usr/errl/errludstring.H b/src/include/usr/errl/errludstring.H
index fb72c5498..795075677 100644
--- a/src/include/usr/errl/errludstring.H
+++ b/src/include/usr/errl/errludstring.H
@@ -69,6 +69,7 @@ private:
#else // (if PARSER defined)
+#include <string.h>
/**
* @class ErrlUserDetailsString
*
@@ -100,7 +101,13 @@ public:
void * i_pBuffer,
const uint32_t i_buflen) const
{
- i_parser.PrintString("String data", static_cast<char *>(i_pBuffer));
+ char *outputString= static_cast<char *>(i_pBuffer);
+ for (uint32_t i = 0; i < i_buflen; )
+ {
+ i_parser.PrintString("String data", outputString);
+ i += strlen(outputString) + 1;
+ outputString += strlen(outputString) + 1;
+ }
}
private:
diff --git a/src/include/usr/errl/errludtarget.H b/src/include/usr/errl/errludtarget.H
index 83c9b8991..c399c1bd3 100644
--- a/src/include/usr/errl/errludtarget.H
+++ b/src/include/usr/errl/errludtarget.H
@@ -118,12 +118,13 @@ public:
uint32_t i = 0;
// errlog data
- uint8_t *l_ptr = static_cast<char *>(i_pBuffer);
+ uint8_t *l_ptr = static_cast<uint8_t *>(i_pBuffer);
+
+ // TODO: needs to be updated to handle merged records
if (*l_ptr == 1) // special - master
{
- //const char *pTargetString = "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL";
- i_parser.PrintString(NULL, "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL");
+ i_parser.PrintString(NULL, "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL");
}
else
{
@@ -212,7 +213,6 @@ public:
for (; i < i_buflen; )
{
-
if ((*l_ptr == 0x15) || // ATTR_PHYS_PATH
(*l_ptr == 0x16)) // ATTR_AFFINITY_PATH
{
@@ -237,8 +237,8 @@ public:
const uint8_t pathSize = (pathTypeLength & 0x0F);
uint8_t *lElementInstance = ((uint8_t *)l_ptr);
l_ptr += pathSize * sizeof(uint8_t);
- for (uint32_t i=0;i<pathSize;i += 2) {
- switch (lElementInstance[i]) {
+ for (uint32_t j=0;j<pathSize;j += 2) {
+ switch (lElementInstance[j]) {
case 0x01: pathString = "/Sys"; break;
case 0x02: pathString = "/Node"; break;
case 0x03: pathString = "/DIMM"; break;
@@ -273,7 +273,7 @@ public:
default: pathString = "/Unknown"; break;
} // switch
// copy next part in, overwritting previous terminator
- dataSize += sprintf(outString + dataSize, "%s%d",pathString,lElementInstance[i+1]);
+ dataSize += sprintf(outString + dataSize, "%s%d",pathString,lElementInstance[j+1]);
} // for
if (*l_ptr == 0x15) // ATTR_PHYS_PATH
{
@@ -283,7 +283,7 @@ public:
{
i_parser.PrintString("ATTR_AFFINITY_PATH", outString);
}
- }
+ }
} // for
}
} // parse()
diff --git a/src/include/usr/errl/errluserdetails.H b/src/include/usr/errl/errluserdetails.H
index 75a00c115..5ffda115b 100755
--- a/src/include/usr/errl/errluserdetails.H
+++ b/src/include/usr/errl/errluserdetails.H
@@ -115,6 +115,11 @@ protected:
*/
errlsubsec_t iv_SubSection;
+ /**
+ * Protected Data: true/false merge like buffers
+ */
+ bool iv_merge;
+
private:
// Disabled
OpenPOWER on IntegriCloud