summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsachin gupta <sgupta2m@in.ibm.com>2013-03-28 06:30:24 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-03 22:10:27 -0500
commitf3af02b13688f74136c9983fb9919bf64b9eb304 (patch)
tree9df991b7e153e777099fb048de4be042366ab206
parente2881514c8101d03fe1e182658637e470e9e356c (diff)
downloadtalos-hostboot-f3af02b13688f74136c9983fb9919bf64b9eb304.tar.gz
talos-hostboot-f3af02b13688f74136c9983fb9919bf64b9eb304.zip
PRD: Removing CPTR from capture data
RTC: 62866 Change-Id: I89f2c2e1143f163affcdaab4061d833917da7a97 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3777 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3858
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/service/prdfPfa5Data.h2
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/service/prdf_ras_services.C62
2 files changed, 32 insertions, 32 deletions
diff --git a/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h b/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h
index ea2ec265c..93df9aa0c 100755
--- a/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h
+++ b/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h
@@ -427,10 +427,8 @@ struct PfaData
struct CaptureDataClass
{
- uint32_t CaptureData_Label; // Label to show start of Capture data.
uint32_t PfaCaptureDataSize;
uint8_t CaptureData[CaptureDataSize]; // MAKMAK Can this be variable size?
- uint32_t EndLabel[2];// Label to show End of Capture Data
};
} // end namespace PRDF
diff --git a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C
index ffe734c17..19f3e943b 100755
--- a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C
+++ b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C
@@ -48,9 +48,6 @@
#include <algorithm>
#include <iipSystem.h> //For RemoveStoppedChips
-// FIXME: RTC: 62866 will investigate the removal of CPTR
-#define CPTR_Identifier 0x43505452
-
#ifdef __HOSTBOOT_MODULE
#define htonl(foo) (foo) // no-op for HB
#include <stdio.h>
@@ -1546,45 +1543,50 @@ void RasServices::MnfgTrace(ErrorSignature * l_esig )
void ErrDataService::AddCapData(ServiceDataCollector & i_sdc, errlHndl_t i_errHdl)
{
- // NOTE: Labels on this structure are not being verified in the
- // plugins. If that behavior changes, we must use htonl()
- // to fix the endianness on them.
-
- CaptureDataClass * l_CapDataBuf = new CaptureDataClass;
+ // As CaptureDataClass has large array inside, allocate it on heap
+ CaptureDataClass *l_CapDataBuf = new CaptureDataClass() ;
for(uint32_t ii = 0; ii < CaptureDataSize; ++ii)
{
l_CapDataBuf->CaptureData[ii] = 0xFF;
}
- l_CapDataBuf->CaptureData_Label = CPTR_Identifier; //Start of Capture Data 'CPTR'
- l_CapDataBuf->EndLabel[0] = 0x454E4420; // End of Capture data
- l_CapDataBuf->EndLabel[1] = 0x44415441; // 'END DATA'
+ uint32_t thisCapDataSize = i_sdc.GetCaptureData().Copy(
+ l_CapDataBuf->CaptureData,
+ CaptureDataSize );
+
+ do
+ {
+ if( 0 == thisCapDataSize )
+ {
+ // Nothing to add
+ break;
+ }
+
+ l_CapDataBuf->PfaCaptureDataSize = htonl( thisCapDataSize );
- uint32_t thisCapDataSize = i_sdc.GetCaptureData().Copy(l_CapDataBuf->CaptureData,CaptureDataSize);
+ thisCapDataSize = thisCapDataSize +
+ sizeof(l_CapDataBuf->PfaCaptureDataSize);
- thisCapDataSize = thisCapDataSize + 32; // include the eye catcher labels
+ //Compress the Capture data
+ size_t l_compressBufSize =
+ PrdfCompressBuffer::compressedBufferMax( thisCapDataSize );
- l_CapDataBuf->PfaCaptureDataSize = thisCapDataSize;
- l_CapDataBuf->PfaCaptureDataSize = htonl(l_CapDataBuf->PfaCaptureDataSize);
+ uint8_t * l_compressCapBuf = new uint8_t[l_compressBufSize];
- //Compress the Capture data
- size_t l_compressBufSize =
- PrdfCompressBuffer::compressedBufferMax(thisCapDataSize);
- const size_t sz_compressCapBuf = l_compressBufSize + 4;
- uint8_t * l_compressCapBuf = new uint8_t[sz_compressCapBuf];
+ PrdfCompressBuffer::compressBuffer( ( ( uint8_t * ) l_CapDataBuf ),
+ (size_t) thisCapDataSize ,
+ l_compressCapBuf,
+ l_compressBufSize);
- memcpy(l_compressCapBuf, l_CapDataBuf, 4); // grab CPTR string
- PrdfCompressBuffer::compressBuffer( &((uint8_t *) l_CapDataBuf)[4],
- (size_t) thisCapDataSize - 4,
- &l_compressCapBuf[4],
- l_compressBufSize);
+ //Actual size of compressed data is returned in l_compressBufSize
+ //Add the Compressed Capture data to Error Log User Data
+ PRDF_ADD_FFDC( i_errHdl, (const char*)l_compressCapBuf,
+ (size_t) l_compressBufSize, ErrlVer2, ErrlCapData_1 );
- //Add the Compressed Capture data to Error Log User Data
- PRDF_ADD_FFDC( i_errHdl, (const char*)l_compressCapBuf,
- sz_compressCapBuf, ErrlVer2, ErrlCapData_1 );
- delete [] l_compressCapBuf;
- delete l_CapDataBuf;
+ delete [] l_compressCapBuf;
+ delete l_CapDataBuf;
+ }while (0);
}
// ----------------------------------------------------------------------------
OpenPOWER on IntegriCloud