diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2014-09-10 17:15:26 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-09-17 10:55:10 -0500 |
commit | eb69ee388334de07daa675f1b073a6695ded71e8 (patch) | |
tree | 2b55ad629aed033f6c2508c9b19a7f3054da5057 /src/usr/diag/prdf/common/plugins | |
parent | d3c9c2c1316e22503cc1094df325e5cd159628d5 (diff) | |
download | talos-hostboot-eb69ee388334de07daa675f1b073a6695ded71e8.tar.gz talos-hostboot-eb69ee388334de07daa675f1b073a6695ded71e8.zip |
PRD: made prettier parsed format for SLW FFDC data
Change-Id: I44382946bbc481ff95ff44aae56b9dc209a87353
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13292
Tested-by: Jenkins Server
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13422
Diffstat (limited to 'src/usr/diag/prdf/common/plugins')
-rw-r--r-- | src/usr/diag/prdf/common/plugins/plugins.mk | 5 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfLogParse_common.C | 31 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfParserEnums.H | 14 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfProcLogParse.C | 91 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfProcLogParse.H | 60 |
5 files changed, 194 insertions, 7 deletions
diff --git a/src/usr/diag/prdf/common/plugins/plugins.mk b/src/usr/diag/prdf/common/plugins/plugins.mk index f2299a373..ef7f8b1fc 100644 --- a/src/usr/diag/prdf/common/plugins/plugins.mk +++ b/src/usr/diag/prdf/common/plugins/plugins.mk @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2004,2014 +# Contributors Listed Below - COPYRIGHT 2013,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,6 +34,7 @@ PRDR_ERRL_LIB = lib${RULE_LIBRARY_NAME} LIBRARY_OFILES += prdfLogParse.o LIBRARY_OFILES += prdfLogParse_common.o LIBRARY_OFILES += prdfCenLogParse.o +LIBRARY_OFILES += prdfProcLogParse.o LIBRARY_OFILES += prdrErrlPluginsSupt.o LIBRARY_OFILES += prdfParserUtils.o diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C index ba166d5a0..05ac519f9 100644 --- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C +++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C @@ -48,7 +48,9 @@ #include <attributeenums.H> // For TARGETING::TYPE enum #include <prdfCenLogParse.H> +#include <prdfProcLogParse.H> #include <prdfGardType.H> +#include <prdfParserEnums.H> //------------------------------------------------------------------------------ // Data structures @@ -251,7 +253,7 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, uint8_t * l_uncompBuffer = new uint8_t[CaptureDataSize]; size_t l_uncompBufSize = CaptureDataSize; CaptureDataClass * l_capData; - memset( l_uncompBuffer, 0xFF,CaptureDataSize); + memset( l_uncompBuffer, 0xFF, CaptureDataSize ); if ( 2 <= i_ver ) // version 2 and above are compressed. { @@ -375,6 +377,10 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, { parseTdCtlrStateData( sigData, sigDataSize, i_parser, sigId ); } + else if ( Util::hashString(SLW_FFDC_DATA::title) == sigId ) + { + parseSlwFfdcData( sigData, sigDataSize, i_parser ); + } else if ( (0 != sigDataSize) && (sizeof(uint64_t) >= sigDataSize) ) { // Print one reg/line if the data size <= 8 bytes @@ -407,21 +413,34 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, } while (true); + i_parser.PrintBlank(); + + // If rc is false and returned to the error log code it will add a hex dump + // of the capture buffer to the end of the user data section. Uncomment this + // line if the raw hex is needed for debug. + //rc = false; + if ( 2 <= i_ver ) // version 2 and above are compressed. { - i_parser.PrintBlank(); i_parser.PrintHeading("Uncompressed Capture Buffer"); i_parser.PrintBlank(); i_parser.PrintHexDump( l_uncompBuffer, l_uncompBufSize ); + i_parser.PrintBlank(); + + if ( false == rc ) + { + i_parser.PrintHeading("Compressed Capture Buffer"); + } } + else + { + i_parser.PrintHeading("Capture Buffer"); - i_parser.PrintBlank(); - i_parser.PrintHeading("Compressed Capture Buffer"); - // NOTE: The compressed buffer is added by the ERRL component. + rc = false; // force raw hex dump + } delete [] l_uncompBuffer; - rc = false; return rc; } diff --git a/src/usr/diag/prdf/common/plugins/prdfParserEnums.H b/src/usr/diag/prdf/common/plugins/prdfParserEnums.H index 625c6dec8..73c7d3895 100644 --- a/src/usr/diag/prdf/common/plugins/prdfParserEnums.H +++ b/src/usr/diag/prdf/common/plugins/prdfParserEnums.H @@ -167,6 +167,20 @@ namespace CEN_SYMBOL }//namespace CEN_SYMBOL ends +namespace SLW_FFDC_DATA +{ + static const char * const title = "SLW_FFDC_DATA"; + + enum + { + MAX_ENTRIES = 39, ///< Maximum number of entries allowed. + ENTRY_SIZE = 12, ///< Number of bytes per entry. + + MAX_SIZE = MAX_ENTRIES * ENTRY_SIZE, ///< Maximum table size. + }; + +} // namespace SLW_FFDC_DATA + #ifdef PRDF_HOSTBOOT_ERRL_PLUGIN } // end namespace HOSTBOOT #endif diff --git a/src/usr/diag/prdf/common/plugins/prdfProcLogParse.C b/src/usr/diag/prdf/common/plugins/prdfProcLogParse.C new file mode 100644 index 000000000..b4be8490a --- /dev/null +++ b/src/usr/diag/prdf/common/plugins/prdfProcLogParse.C @@ -0,0 +1,91 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plugins/prdfProcLogParse.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfProcLogParse.C + * @brief Error log parsing code specific to the processor subsystem. + */ + +#include <prdfProcLogParse.H> + +#include <errlusrparser.H> +#include <cstring> +#include <iipconst.h> +#include <prdfParserEnums.H> +#include <netinet/in.h> + +namespace PRDF +{ + +#ifdef PRDF_HOSTBOOT_ERRL_PLUGIN +namespace HOSTBOOT +#else +namespace FSP +#endif +{ + +using namespace PARSER; + +//------------------------------------------------------------------------------ + +bool parseSlwFfdcData( uint8_t * i_buffer, uint32_t i_buflen, + ErrlUsrParser & i_parser ) +{ + char hdr[HEADER_SIZE] = ""; + char data[DATA_SIZE] = ""; + + snprintf( hdr, HEADER_SIZE, " %s", SLW_FFDC_DATA::title ); + i_parser.PrintString( hdr, "" ); + + const size_t sz_word = sizeof(uint32_t); + + uint32_t idx = 0; + while ( idx + SLW_FFDC_DATA::ENTRY_SIZE < i_buflen ) + { + uint32_t addr, val0, val1; + + memcpy( &addr, &i_buffer[idx ], sz_word ); + memcpy( &val0, &i_buffer[idx+(1*sz_word)], sz_word ); + memcpy( &val1, &i_buffer[idx+(2*sz_word)], sz_word ); + + addr = htonl(addr); + val0 = htonl(val0); + val1 = htonl(val1); + + snprintf(hdr, HEADER_SIZE, " Address: 0x%08x", addr ); + snprintf(data, DATA_SIZE, "Value: 0x%08x 0x%08x", val0, val1 ); + + i_parser.PrintString( hdr, data ); + + idx += SLW_FFDC_DATA::ENTRY_SIZE; + } + + return true; +} + +//------------------------------------------------------------------------------ + +} // namespace FSP/HOSTBBOT +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/plugins/prdfProcLogParse.H b/src/usr/diag/prdf/common/plugins/prdfProcLogParse.H new file mode 100644 index 000000000..cc1fa3d14 --- /dev/null +++ b/src/usr/diag/prdf/common/plugins/prdfProcLogParse.H @@ -0,0 +1,60 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plugins/prdfProcLogParse.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfProcLogParse.H + * @brief Error log parsing code specific to the processor subsystem. + */ + +#ifndef __prdfProcLogParse_H +#define __prdfProcLogParse_H + +#include <stdint.h> + +class ErrlUsrParser; + +namespace PRDF +{ +#ifdef PRDF_HOSTBOOT_ERRL_PLUGIN +namespace HOSTBOOT +#else +namespace FSP +#endif +{ + +/** + * @brief Parses the SLW FFDC data section. + * @param i_buffer The data buffer. + * @param i_buflen The buffer length. + * @param i_parser The error log parser. + */ +bool parseSlwFfdcData( uint8_t * i_buffer, uint32_t i_buflen, + ErrlUsrParser & i_parser ); + +} // namespace FSP/HOSTBBOT +} // end namespace PRDF + +#endif // __prdfProcLogParse_H + + |