summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2014-04-28 17:31:16 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-05-08 16:49:28 -0500
commit6945442c208de3aa90088e03c15f0cdad0dd4d3b (patch)
treeaffd5a2689a354c77d63a3f23545e6330168ac2e /src
parent9b5488b6355fe0c23d83ded9b7524e002b6d3111 (diff)
downloadtalos-hostboot-6945442c208de3aa90088e03c15f0cdad0dd4d3b.tar.gz
talos-hostboot-6945442c208de3aa90088e03c15f0cdad0dd4d3b.zip
Provide mechanism to make an error log severity "final"
Add a set sev method that sets the severity as final. Set the errors identified in SW249695 as "final". Change-Id: I4fc00e075ecdbfcfb2f9f6d8b64c05e2de754f2f RTC: 105536 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/10819 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/errl/errlentry.H35
-rw-r--r--src/usr/errl/errlentry.C3
-rw-r--r--src/usr/initservice/baseinitsvc/initservice.C6
3 files changed, 39 insertions, 5 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index d9d39cb51..352cbeb97 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -163,7 +163,8 @@ public:
* The severity of a log determines how severe the
* problem is perceived to be. The severity is
* initially set by the parameter in the constructor
- * and can be changed at any point thereafter.
+ * and can be changed at any point thereafter, unless the
+ * the severity has been set as "final".
*
* @param[in] i_sev Severity. See errl/errltypes.H
*
@@ -171,9 +172,36 @@ public:
*/
void setSev(const errlSeverity_t i_sev)
{
- iv_User.iv_severity = i_sev;
+ if (false == iv_sevFinal) // update severity as long as not set "final"
+ {
+ iv_User.iv_severity = i_sev;
+ }
}
+ /**
+ * @brief Set the log's severity "final".
+ * The severity being set will be set as "final" such that it can
+ * not be changed again. Setting a severity as "final" can be used
+ * in the less frequent case that a severity should not be
+ * changed by code at a higher level.
+ *
+ * @param[in] i_sev Severity. See errl/errltypes.H
+ * @param[in] i_final true: If not already "final", sets severity and
+ * marks the severity as "final"
+ * false: If not "final", sets severity
+ *
+ * @return void
+ */
+ void setSev(const errlSeverity_t i_sev,
+ bool i_final)
+ {
+
+ if (false == iv_sevFinal) // as long as not already set as "final"
+ {
+ iv_User.iv_severity = i_sev; // set severity
+ iv_sevFinal = i_final; // set whether severity is "final"
+ }
+ }
/**
* @brief Get reason code. See errl/errlreasoncodes.H
@@ -665,6 +693,9 @@ private:
// hostboot.
errlTermState_t iv_termState;
+ // when true, the severity has been set "final" and can not be changed.
+ bool iv_sevFinal;
+
};
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index aa05d534a..ff6eab8f9 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -151,7 +151,8 @@ ErrlEntry::ErrlEntry(const errlSeverity_t i_sev,
// The SRC_ERR_INFO becomes part of the SRC; example, B1 in SRC B180xxxx
// iv_Src assigns the epubSubSystem_t; example, 80 in SRC B180xxxx
iv_Src( SRC_ERR_INFO, i_modId, i_reasonCode, i_user1, i_user2 ),
- iv_termState(TERM_STATE_UNKNOWN)
+ iv_termState(TERM_STATE_UNKNOWN),
+ iv_sevFinal(false)
{
TRACFCOMP( g_trac_errl, ERR_MRK"Error created : PLID=%.8X, RC=%.4X, Mod=%.2X, Userdata=%.16X %.16X", plid(), i_reasonCode, i_modId, i_user1, i_user2 );
// Collect the Backtrace and add it to the error log
diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C
index 3a437b933..03bb011e4 100644
--- a/src/usr/initservice/baseinitsvc/initservice.C
+++ b/src/usr/initservice/baseinitsvc/initservice.C
@@ -273,7 +273,8 @@ errlHndl_t InitService::startTask(
if ((l_childsts == TASK_STATUS_CRASHED) &&
(NULL != l_childerrl))
{
- l_errl->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ l_errl->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL,
+ true); //set severity "final"
}
break;
} // endif tidretrc
@@ -404,7 +405,8 @@ errlHndl_t InitService::executeFn(
if ((l_childsts == TASK_STATUS_CRASHED) &&
(NULL != l_childerrl))
{
- l_errl->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ l_errl->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL,
+ true); //set severity "final"
}
TRACFCOMP(g_trac_initsvc,
OpenPOWER on IntegriCloud