summaryrefslogtreecommitdiffstats
path: root/src/usr/errl
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-11-27 10:24:27 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-13 12:33:21 -0400
commit21080c6885b10977d4a1fe51e2dba79cb67d26c8 (patch)
tree8d72c6c5b363788968bb47c8b67a9e8577b6dd83 /src/usr/errl
parentafb0e6a438eeda79822dd1dde73b98e6a87fde5b (diff)
downloadtalos-hostboot-21080c6885b10977d4a1fe51e2dba79cb67d26c8.tar.gz
talos-hostboot-21080c6885b10977d4a1fe51e2dba79cb67d26c8.zip
Log Hostboot state information in all error logs
Add the Istep number and substep number to Hostboot Error Logs to assist in problem debug. These items will be added as a user data record to all Hostboot Error Logs prior to Runtime. Change-Id: Ib5d269f3c1853d6d6856669744630dc130fa7094 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54764 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
-rw-r--r--src/usr/errl/errl.mk3
-rw-r--r--src/usr/errl/errlentry.C16
-rw-r--r--src/usr/errl/errludstate.C68
-rw-r--r--src/usr/errl/plugins/errludparserfactoryerrl.H6
-rw-r--r--src/usr/errl/plugins/errludstate.H113
5 files changed, 203 insertions, 3 deletions
diff --git a/src/usr/errl/errl.mk b/src/usr/errl/errl.mk
index 43bbd5df6..ce1c5c0e8 100644
--- a/src/usr/errl/errl.mk
+++ b/src/usr/errl/errl.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2017
+# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
@@ -38,4 +38,5 @@ OBJS += errludbacktrace.o
OBJS += errludlogregister.o
OBJS += errludcallout.o
OBJS += errludsensor.o
+OBJS += errludstate.o
OBJS += errlmanager_common.o
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index c05d10d1d..ea93a0ad0 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -44,6 +44,7 @@
#include <errl/errludstring.H>
#include <errl/errluserdetails.H>
#include <errl/errludattribute.H>
+#include <errl/errludstate.H>
#include <trace/interface.H>
#include <arch/ppc.H>
#include <hwas/common/hwasCallout.H>
@@ -99,6 +100,21 @@ ErrlEntry::ErrlEntry(const errlSeverity_t i_sev,
#endif
// Collect the Backtrace and add it to the error log
iv_pBackTrace = new ErrlUserDetailsBackTrace();
+
+#ifndef __HOSTBOOT_RUNTIME
+ // Add the istep data to the vector of sections for this error log
+ ErrlUserDetailsSysState * l_pErrlUserDetailsSysState =
+ new ErrlUserDetailsSysState();
+
+ ErrlUD * l_pUdSection = new ErrlUD( l_pErrlUserDetailsSysState,
+ sizeof(ErrlUserDetailsSysState),
+ ERRL_COMP_ID,
+ 1,
+ ERRL_UDT_SYSSTATE );
+
+ iv_SectionVector.push_back( l_pUdSection );
+#endif
+
// Automatically add a software callout if asked
if( i_hbSwError )
{
diff --git a/src/usr/errl/errludstate.C b/src/usr/errl/errludstate.C
new file mode 100644
index 000000000..f31bccf4f
--- /dev/null
+++ b/src/usr/errl/errludstate.C
@@ -0,0 +1,68 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/errl/errludstate.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* [+] 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 errludsysstate.C
+ *
+ * @brief Implementation of ErrlUserDetailsSysState
+ */
+#include <errl/errludstate.H>
+#include <errl/errlreasoncodes.H>
+#include <initservice/initserviceif.H>
+
+namespace ERRORLOG
+{
+
+ ErrlUserDetailsSysState::ErrlUserDetailsSysState()
+ {
+ //***** Memory Layout *****
+ // 1 bytes : Major Istep
+ // 1 bytes : Minor Istep
+ const size_t TOTAL_SIZE = 2;
+
+ uint8_t l_iStep = 0;
+ uint8_t l_subStep = 0;
+
+#ifndef __HOSTBOOT_RUNTIME
+ INITSERVICE::GetIstepData( l_iStep,
+ l_subStep );
+#endif
+
+ uint8_t* l_buf = reinterpret_cast<uint8_t*>(
+ reallocUsrBuf(TOTAL_SIZE));
+ memset( l_buf, 0, TOTAL_SIZE );
+ l_buf[0] = l_iStep;
+ l_buf[1] = l_subStep;
+
+ // Set up ErrlUserDetails instance variables
+ iv_CompId = ERRL_COMP_ID;
+ iv_Version = 1;
+ iv_SubSection = ERRL_UDT_SYSSTATE;
+ }
+
+ ErrlUserDetailsSysState::~ErrlUserDetailsSysState()
+ {
+
+ }
+}
diff --git a/src/usr/errl/plugins/errludparserfactoryerrl.H b/src/usr/errl/plugins/errludparserfactoryerrl.H
index 3859e8250..923632852 100644
--- a/src/usr/errl/plugins/errludparserfactoryerrl.H
+++ b/src/usr/errl/plugins/errludparserfactoryerrl.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,6 +39,7 @@
#include "errludcallout.H"
#include "errludsensor.H"
#include "errludbuild.H"
+#include "errludstate.H"
namespace ERRORLOG
{
@@ -67,7 +68,8 @@ public:
registerParser<ErrlUserDetailsParserCallout>(ERRL_UDT_CALLOUT);
registerParser<ErrlUserDetailsParserSensor>(ERRL_UDT_SENSOR);
registerParser<ErrlUserDetailsParserBuild>(ERRL_UDT_BUILD);
- }
+ registerParser<ErrlUserDetailsParserSysState>(ERRL_UDT_SYSSTATE);
+ }
private:
diff --git a/src/usr/errl/plugins/errludstate.H b/src/usr/errl/plugins/errludstate.H
new file mode 100644
index 000000000..ac6517b17
--- /dev/null
+++ b/src/usr/errl/plugins/errludstate.H
@@ -0,0 +1,113 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/errl/plugins/errludstate.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* [+] 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 */
+#ifndef ERRL_UDSTATEP_H
+#define ERRL_UDSTATEP_H
+
+/**
+ * @file errludsensor.H
+ *
+ * Defines the ErrlUserDetailsParserState class that parses system
+ * state info from user detail in an error log
+ */
+
+#include "errluserdetails.H"
+#include <targeting/common/target.H>
+
+namespace ERRORLOG
+{
+
+/**
+ * @class ErrlUserDetailsParserSysState
+ *
+ * Parses System state information from user detail in an error log
+ */
+class ErrlUserDetailsParserSysState :public ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ ErrlUserDetailsParserSysState() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~ErrlUserDetailsParserSysState() {}
+
+ /**
+ * @brief Parses State user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing Istep state data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ //***** Memory Layout *****
+ // 1 bytes : Major Istep
+ // 1 bytes : Minor Istep
+ const size_t TOTAL_SIZE = 2;
+
+ uint8_t* l_data = static_cast<uint8_t*>(i_pBuffer);
+
+ if( i_buflen >= TOTAL_SIZE )
+ {
+ i_parser.PrintNumber("Current Major Istep", "%d",
+ l_data[0]);
+ i_parser.PrintNumber("Current Minor Istep", "%d",
+ l_data[1]);
+
+ if( i_buflen > TOTAL_SIZE )
+ {
+ // Print out extra data as hex so that an old parser will
+ // still display new data that gets logged in the code
+ i_parser.PrintHexDump( (l_data+2), i_buflen-2 );
+ }
+ }
+
+ else
+ {
+ // Just print out whatever we have if it is less than
+ // the data size we are aware of
+ i_parser.PrintNumber("State Buffer length", "0x%X", i_buflen);
+ i_parser.PrintNumber("Expected length", "0x%X", TOTAL_SIZE);
+ i_parser.PrintHexDump(i_pBuffer, i_buflen);
+ }
+ }
+
+private:
+ // Disabled
+ ErrlUserDetailsParserSysState(const ErrlUserDetailsParserSysState &);
+ ErrlUserDetailsParserSysState & operator=(
+ const ErrlUserDetailsParserSysState &);
+};
+
+}
+
+#endif
OpenPOWER on IntegriCloud