summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/plugins/prdfProcLogParse.C
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2014-09-10 17:15:26 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-09-17 10:55:10 -0500
commiteb69ee388334de07daa675f1b073a6695ded71e8 (patch)
tree2b55ad629aed033f6c2508c9b19a7f3054da5057 /src/usr/diag/prdf/common/plugins/prdfProcLogParse.C
parentd3c9c2c1316e22503cc1094df325e5cd159628d5 (diff)
downloadtalos-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/prdfProcLogParse.C')
-rw-r--r--src/usr/diag/prdf/common/plugins/prdfProcLogParse.C91
1 files changed, 91 insertions, 0 deletions
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
+
OpenPOWER on IntegriCloud