From 1b488dc46eca2655066988c238c4ba059e7afe7c Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Fri, 13 Feb 2015 03:27:01 -0600 Subject: PRD: Add FFDC support for PNOR FIRDATA section Change-Id: Ib20a43397cd6620c5223d50e4a363549a2d32ba4 RTC: 119623 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15717 Tested-by: Jenkins Server Reviewed-by: Prem Shanker Jha Reviewed-by: Christopher T. Phan Reviewed-by: A. Patrick Williams III --- .../diag/prdf/common/plugins/prdfLogParse_common.C | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'src/usr/diag') diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C index c1718491c..718268377 100644 --- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C +++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C @@ -112,6 +112,9 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, bool parsePfaData( void * i_buffer, uint32_t i_buflen, ErrlUsrParser & i_parser ); +bool parsePnorFirData( uint8_t * i_buffer, uint32_t i_buflen, + ErrlUsrParser & i_parser ); + //############################################################################## //## //## Utility Functions @@ -393,6 +396,10 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, { parseL3LdCrFfdc( sigData, sigDataSize, i_parser ); } + else if ( Util::hashString("OCC_CS_FFDC") == sigId) + { + parsePnorFirData( sigData, sigDataSize, i_parser ); + } else if ( (0 != sigDataSize) && (sizeof(uint64_t) >= sigDataSize) ) { // Print one reg/line if the data size <= 8 bytes @@ -655,6 +662,61 @@ bool parseMemMru( void * i_buffer, uint32_t i_buflen, ErrlUsrParser & i_parser ) return o_rc; } +//------------------------------------------------------------------------------ + +bool parsePnorFirData( uint8_t * i_buffer, uint32_t i_buflen, + ErrlUsrParser & i_parser ) +{ + using namespace PARSER; + + bool o_rc = false; + + i_parser.PrintString( " OCC_CS_FFDC", "" ); + + do + { + if ( NULL == i_buffer ) break; + + size_t u16 = sizeof(uint16_t); + size_t u32 = sizeof(uint32_t); + + // Make sure there is enough room for the header data. + if ( i_buflen < u32 ) break; + + uint32_t noTrgts = i_buffer[0]; + bool full = (1 == (i_buffer[1] >> 7)); + + i_parser.PrintNumber( " # of targets", "%d", noTrgts ); + i_parser.PrintBool( " PNOR buffer full", full ); + + uint32_t cnt = i_buffer[3]; + + // Make sure there is enough room for the SCOM error data. + if ( cnt * (u32 + u16) < i_buflen - u32 ) break; + + uint32_t idx = u32; + for ( uint32_t i = 0; i < cnt; ++i ) + { + uint32_t huid = 0; uint16_t scomErrs = 0; + memcpy( &huid, &i_buffer[idx], u32 ); idx += u32; + memcpy( &scomErrs, &i_buffer[idx], u16 ); idx += u16; + + char header[HEADER_SIZE]; + snprintf( header, HEADER_SIZE, " HUID = 0x%08x", huid ); + + char data[DATA_SIZE]; + snprintf( data, DATA_SIZE, "SCOM Errors = %d", scomErrs ); + + i_parser.PrintString( header, data ); + } + + o_rc = true; + + } while (0); + + return o_rc; +} + //############################################################################## //## //## Error Log Plugins -- cgit v1.2.1