Skip to content

Commit

Permalink
Minor Error Log Improvements
Browse files Browse the repository at this point in the history
This commit adds the error log severity to the trace saying that
a new error log is being created.  It also cleans up an unused
variable in some error log parsing logic.

Change-Id: Iff196993bdabf80ad65006fca195f0785221257f
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63476
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@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: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Jul 30, 2018
1 parent e4f0610 commit 887663e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/include/usr/errl/hberrltypes.H
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ enum errlSectionId_t
*
* Refer to this ErrlEntry setter:
* void ErrlEntry::setSev(const errlSeverity_t i_sev)
*
* NOTE: If any values are added, please update std::map errl_sev_str_map
* in errlentry.C
*/
enum errlSeverity_t
{
Expand Down
16 changes: 14 additions & 2 deletions src/usr/errl/errlentry.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <hbotcompid.H>
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
Expand Down Expand Up @@ -74,6 +75,17 @@ namespace ERRORLOG
trace_desc_t* g_trac_errl = NULL;
TRAC_INIT(&g_trac_errl, "ERRL", KILOBYTE, TRACE::BUFFER_SLOW);

// std::map to trace severity in trace
// NOTE: must be kept in sync with enum definition in hberrltypes.H
std::map<uint8_t, const char *> errl_sev_str_map {
{ERRL_SEV_INFORMATIONAL, "INFORMATIONAL"},
{ERRL_SEV_RECOVERED, "RECOVERED"},
{ERRL_SEV_PREDICTIVE, "PREDICTIVE"},
{ERRL_SEV_UNRECOVERABLE, "UNRECOVERABLE"},
{ERRL_SEV_CRITICAL_SYS_TERM, "CRITICAL_SYS_TERM"},
{ERRL_SEV_UNKNOWN, "UNKNOWN"},
};

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
ErrlEntry::ErrlEntry(const errlSeverity_t i_sev,
Expand All @@ -95,9 +107,9 @@ ErrlEntry::ErrlEntry(const errlSeverity_t i_sev,
iv_doHbDump(i_hbDump)
{
#ifdef CONFIG_ERRL_ENTRY_TRACE
TRACFCOMP( g_trac_errl, ERR_MRK"Error created : PLID=%.8X, RC=%.4X, Mod=%.2X, Userdata=%.16llX %.16llX", plid(), i_reasonCode, i_modId, i_user1, i_user2 );
TRACFCOMP( g_trac_errl, ERR_MRK"Error created : PLID=%.8X, RC=%.4X, Mod=%.2X, Userdata=%.16llX %.16llX, Sev=%s", plid(), i_reasonCode, i_modId, i_user1, i_user2, errl_sev_str_map.at(i_sev) );
#else
TRACDCOMP( g_trac_errl, ERR_MRK"Error created : PLID=%.8X, RC=%.4X, Mod=%.2X, Userdata=%.16llX %.16llX", plid(), i_reasonCode, i_modId, i_user1, i_user2 );
TRACDCOMP( g_trac_errl, ERR_MRK"Error created : PLID=%.8X, RC=%.4X, Mod=%.2X, Userdata=%.16llX %.16llX, Sev=%s", plid(), i_reasonCode, i_modId, i_user1, i_user2, errl_sev_str_map.at(i_sev) );
#endif
// Collect the Backtrace and add it to the error log
iv_pBackTrace = new ErrlUserDetailsBackTrace();
Expand Down
1 change: 0 additions & 1 deletion src/usr/secureboot/common/plugins/errludP_secure.H
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ class UdParserNodeCommInfo : public ERRORLOG::ErrlUserDetailsParser
// 1 byte : MboxId

char* l_databuf = static_cast<char*>(i_pBuffer);
bool l_parseError = false;

do
{
Expand Down

0 comments on commit 887663e

Please sign in to comment.