diff options
author | Mike Jones <mjjones@us.ibm.com> | 2012-03-16 11:30:45 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-03-21 16:41:45 -0500 |
commit | 13cba5a729ae4e0f7e6f0f23b6b302e63e1f2ade (patch) | |
tree | 121076fad6e415df8cccd7cecac7f729cdc437e0 /src/usr/hwpf/fapi | |
parent | 0c281617a249edc58f4b615355ab0221084b1330 (diff) | |
download | blackbird-hostboot-13cba5a729ae4e0f7e6f0f23b6b302e63e1f2ade.tar.gz blackbird-hostboot-13cba5a729ae4e0f7e6f0f23b6b302e63e1f2ade.zip |
HWPF: Decode HWP FFDC in error logs
RTC: 37921
Change-Id: I6c8bbe5e92eb6e22eb18cba3529128ae70a9786f
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/768
Tested-by: Jenkins Server
Reviewed-by: Mark W. Wenning <wenning@us.ibm.com>
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/fapi')
-rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfo.C | 35 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiReturnCode.C | 19 |
2 files changed, 24 insertions, 30 deletions
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C index f052c8b70..7bc25a058 100644 --- a/src/usr/hwpf/fapi/fapiErrorInfo.C +++ b/src/usr/hwpf/fapi/fapiErrorInfo.C @@ -33,6 +33,8 @@ * mjjones 08/05/2011 Created * mjjones 08/24/2011 Added ErrorInfoGard. * mjjones 09/22/2011 Major updates + * mjjones 03/16/2012 Add FfdcType. Remove copy + * ctor and assignment operator */ #include <fapiErrorInfo.H> @@ -45,24 +47,15 @@ namespace fapi // ErrorInfoFfdc Constructor //****************************************************************************** ErrorInfoFfdc::ErrorInfoFfdc(const void * i_pFfdc, - const uint32_t i_size) -: iv_size(i_size) + const uint32_t i_size, + const FfdcType i_type) +: iv_size(i_size), iv_type(i_type) { iv_pFfdc = new uint8_t[i_size]; memcpy(iv_pFfdc, i_pFfdc, i_size); } //****************************************************************************** -// ErrorInfoFfdc Copy Constructor -//****************************************************************************** -ErrorInfoFfdc::ErrorInfoFfdc(const ErrorInfoFfdc & i_right) -: iv_size(i_right.iv_size) -{ - iv_pFfdc = new uint8_t[i_right.iv_size]; - memcpy(iv_pFfdc, i_right.iv_pFfdc, i_right.iv_size); -} - -//****************************************************************************** // ErrorInfoFfdc Destructor //****************************************************************************** ErrorInfoFfdc::~ErrorInfoFfdc() @@ -72,24 +65,20 @@ ErrorInfoFfdc::~ErrorInfoFfdc() } //****************************************************************************** -// ErrorInfoFfdc Assignment Operator +// ErrorInfoFfdc getData function //****************************************************************************** -ErrorInfoFfdc & ErrorInfoFfdc::operator=(const ErrorInfoFfdc & i_right) +const void * ErrorInfoFfdc::getData(uint32_t & o_size) const { - delete [] iv_pFfdc; - iv_pFfdc = new uint8_t[i_right.iv_size]; - memcpy(iv_pFfdc, i_right.iv_pFfdc, i_right.iv_size); - iv_size = i_right.iv_size; - return *this; + o_size = iv_size; + return iv_pFfdc; } //****************************************************************************** -// ErrorInfoFfdc getData function +// ErrorInfoFfdc getType function //****************************************************************************** -const void * ErrorInfoFfdc::getData(uint32_t & o_size) const +FfdcType ErrorInfoFfdc::getType() const { - o_size = iv_size; - return iv_pFfdc; + return iv_type; } //****************************************************************************** diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C index 2de1f8e13..a8e13cabc 100644 --- a/src/usr/hwpf/fapi/fapiReturnCode.C +++ b/src/usr/hwpf/fapi/fapiReturnCode.C @@ -41,6 +41,7 @@ * mjjones 09/22/2011 Added ErrorInfo Support * mjjones 01/12/2012 Enforce correct usage * mjjones 02/22/2012 Allow user to add Target FFDC + * mjjones 03/16/2012 Add type to FFDC data */ #include <fapiReturnCode.H> @@ -65,7 +66,10 @@ ReturnCode::ReturnCode() : ReturnCode::ReturnCode(const ReturnCodes i_rcValue) : iv_rcValue(i_rcValue), iv_pDataRef(NULL) { - + if (i_rcValue != FAPI_RC_SUCCESS) + { + FAPI_ERR("ctor: Creating error 0x%x", i_rcValue); + } } //****************************************************************************** @@ -151,6 +155,7 @@ ReturnCode::operator uint32_t() const //****************************************************************************** void ReturnCode::setFapiError(const ReturnCodes i_rcValue) { + FAPI_ERR("setFapiError: Creating FAPI error 0x%x", i_rcValue); iv_rcValue = i_rcValue; // Forget about any associated data (this is a new error) @@ -162,6 +167,7 @@ void ReturnCode::setFapiError(const ReturnCodes i_rcValue) //****************************************************************************** void ReturnCode::setEcmdError(const uint32_t i_rcValue) { + FAPI_ERR("setEcmdError: Creating ECMD error 0x%x", i_rcValue); iv_rcValue = i_rcValue; // Forget about any associated data (this is a new error) @@ -173,6 +179,7 @@ void ReturnCode::setEcmdError(const uint32_t i_rcValue) //****************************************************************************** void ReturnCode::setPlatError(void * i_pData) { + FAPI_ERR("setPlatError: Creating PLAT error"); iv_rcValue = FAPI_RC_PLAT_ERR_SEE_DATA; // Forget about any associated data (this is a new error) @@ -244,7 +251,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, { // This is a regular FFDC data object that can be directly // memcopied - addEIFfdc(l_pObject, l_size); + addEIFfdc(l_pObject, l_size, FFDC_TYPE_DATA); } else { @@ -252,7 +259,6 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_ECMDDB) { // The FFDC is a ecmdDataBufferBase - FAPI_ERR("addErrorInfo: Adding ecmdDB FFDC"); const ecmdDataBufferBase * l_pDb = static_cast<const ecmdDataBufferBase *>(l_pObject); ReturnCodeFfdc::addEIFfdc(*this, *l_pDb); @@ -260,7 +266,6 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_TARGET) { // The FFDC is a fapi::Target - FAPI_ERR("addErrorInfo: Adding fapi::Target FFDC"); const fapi::Target * l_pTarget = static_cast<const fapi::Target *>(l_pObject); ReturnCodeFfdc::addEIFfdc(*this, *l_pTarget); @@ -313,12 +318,12 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, // addEIFfdc function //****************************************************************************** void ReturnCode::addEIFfdc(const void * i_pFfdc, - const uint32_t i_size) + const uint32_t i_size, + const FfdcType i_type) { // Create a ErrorInfoFfdc object and add it to the Error Information - FAPI_ERR("addEIFfdc: Adding FFDC, size: %d", i_size); ensureDataRefExists(); - ErrorInfoFfdc * l_pFfdc = new ErrorInfoFfdc(i_pFfdc, i_size); + ErrorInfoFfdc * l_pFfdc = new ErrorInfoFfdc(i_pFfdc, i_size, i_type); iv_pDataRef->getCreateErrorInfo().iv_ffdcs.push_back(l_pFfdc); } |