summaryrefslogtreecommitdiffstats
path: root/src/usr/errl/errludlogregister.C
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-02-26 16:40:57 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-03-13 09:26:19 -0500
commit436bc524c3cada8c1c5c9c64e4c173a77f195410 (patch)
treedf10a266e972b59fc6470a33ede7d7282e10d0a0 /src/usr/errl/errludlogregister.C
parent19d913c39aa031f0f88828b09d581503c7cbdcf2 (diff)
downloadtalos-hostboot-436bc524c3cada8c1c5c9c64e4c173a77f195410.tar.gz
talos-hostboot-436bc524c3cada8c1c5c9c64e4c173a77f195410.zip
update user-detail errog log parsers
update errolog parsers to format the data for the following: . errludtarget . errludattribute . errludlogregister . errludcallout Change-Id: I8fddb3eefd76413e70f4e894ef19649b74682859 RTC: 41707 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3350 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl/errludlogregister.C')
-rw-r--r--src/usr/errl/errludlogregister.C37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/usr/errl/errludlogregister.C b/src/usr/errl/errludlogregister.C
index 722b3680a..244b8d5ec 100644
--- a/src/usr/errl/errludlogregister.C
+++ b/src/usr/errl/errludlogregister.C
@@ -53,10 +53,15 @@ void ErrlUserDetailsLogRegister::setStateLogHUID()
// write the HUID of the target into the error log buffer
uint32_t attrHuid = get_huid(iv_pTarget);
- char *pBuf;
- pBuf = reinterpret_cast<char *>(reallocUsrBuf(sizeof(attrHuid)));
- memcpy(pBuf, &attrHuid, sizeof(attrHuid));
- iv_dataSize += sizeof(attrHuid);
+ uint8_t *pBuf = reinterpret_cast<uint8_t *>
+ (reallocUsrBuf(sizeof(uint32_t) + sizeof(uint8_t)));
+ memcpy(pBuf, &attrHuid, sizeof(uint32_t));
+ iv_dataSize += sizeof(uint32_t);
+
+ // add space for the count and initialize to 0
+#define REGISTER_COUNT_OFFSET (sizeof(uint32_t))
+ *(pBuf + REGISTER_COUNT_OFFSET) = 0;
+ iv_dataSize += sizeof(uint8_t);
} // setStateLogHUID
@@ -97,6 +102,10 @@ void ErrlUserDetailsLogRegister::writeRegisterData(
memcpy(pBuf + iv_dataSize, i_dataBuf, i_dataSize);
iv_dataSize += i_dataSize;
}
+
+ // increment the count
+ *(pBuf + REGISTER_COUNT_OFFSET) += 1;
+
} // writeRegisterData
// internal function:
@@ -107,7 +116,7 @@ void ErrlUserDetailsLogRegister::readRegister(
// (DeviceFW::PRESENT is an example, but we chose not to log that type)
int32_t numAddressArgs = -1;
- // do we do the deviceOpValist or not, and how many
+ // do we do the deviceOpValist or not, and how many
// parameters are there to be logged
switch (i_accessType)
{
@@ -165,14 +174,17 @@ void ErrlUserDetailsLogRegister::readRegister(
i_accessType);
delete errl; // eat the error - just delete it
- reg_size = 0; // in case deviceOpValist didn't reset
+ // nothing gets written out
+ }
+ else
+ {
+ // internal worker function to put reg data into the log
+ writeRegisterData(&reg_data, reg_size, numAddressArgs,
+ i_accessType, i_args);
+ TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize);
}
-
- // internal worker function to put reg data into the log
- writeRegisterData(&reg_data, reg_size, numAddressArgs,
- i_accessType, i_args);
- TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize);
}
+ // else: nothing gets written out
} // readRegister
// internal function:
@@ -184,7 +196,7 @@ void ErrlUserDetailsLogRegister::copyRegisterData(
// (DeviceFW::PRESENT is an example, but we chose not to log that type)
int32_t numAddressArgs = -1;
- // do we do the deviceOpValist or not, and how many
+ // do we do the deviceOpValist or not, and how many
// parameters are there to be logged
switch (i_accessType)
{
@@ -230,6 +242,7 @@ void ErrlUserDetailsLogRegister::copyRegisterData(
i_accessType, i_args);
TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize);
}
+ // else: nothing gets written out
} // copyRegisterData
//------------------------------------------------------------------------------
OpenPOWER on IntegriCloud