summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2012-03-12 15:28:10 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-03-16 09:53:10 -0500
commitf1760e04ceab564f8cef0c8d267bece75cce116c (patch)
tree285afb6fa850a01e1fe584313f7908f9fb9e701d
parent8a1168142bd3f273dbd4edf841c53a3ae394cd5e (diff)
downloadtalos-hostboot-f1760e04ceab564f8cef0c8d267bece75cce116c.tar.gz
talos-hostboot-f1760e04ceab564f8cef0c8d267bece75cce116c.zip
ERRL: Interface to remove backtrace from error log
RTC: 37794 Change-Id: I944f6ed9c86c64e0d3a84649d1f71e66a9aaa7c3 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/732 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/errl/errlentry.H25
-rw-r--r--src/usr/errl/errlentry.C25
2 files changed, 34 insertions, 16 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index 32eb5a1ea..1b71aa39d 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -63,15 +63,7 @@ namespace ERRORLOG
// Forward class declarations
/*****************************************************************************/
class ErrlManager;
-
-
-
-
-// In Sprint 6, the return from errl->addFFDC changed from
-// ErrlFFDC* to ErrlUD*. This typedef is for compatibility in
-// case anybody previously stored the return from errl->addFFDC() as
-// ErrlFFDC *.
-typedef ErrlUD ErrlFFDC;
+class ErrlUserDetailsBackTrace;
/**
* @brief Host Boot Error log entry class.
@@ -100,6 +92,9 @@ public:
* Platform Event Log and SRC PLDD at: https://mcdoc.boeblingen.de.
* ibm.com/out/out.ViewDocument.php?documentid=1675
*
+ * The backtrace is captured as user detail data. Use removeBackTrace to
+ * remove
+ *
* The order of parameters is arranged so that Host Boot error log
* is as close to SP as possible.
*
@@ -350,9 +345,14 @@ public:
bool collectTrace(const char i_name[],
const uint64_t i_max = 0);
-
-
-
+ /**
+ * @brief Remove the back trace user detail data
+ * When an error log is constructed, the back trace is automatically
+ * captured. This function removes the backtrace. This should be used when
+ * a caller knows that the backtrace is of no use and wants to limit the
+ * size of the error log.
+ */
+ void removeBackTrace();
private:
/**
@@ -467,6 +467,7 @@ private:
ErrlSrc iv_Src; // primary SRC section
std::vector<ErrlUD*> iv_SectionVector; // list of user defined sections
std::vector<uint64_t> iv_btAddrs; // list of addresses for the backtrace
+ ErrlUserDetailsBackTrace * iv_pBackTrace; // Pointer to back trace
// TODO need to interpret term state and terminate accordingly.
// TODO termstate is presently not being flattend into PEL
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index ad83ce3df..b71c45f7b 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -61,7 +61,7 @@ ErrlEntry::ErrlEntry(const errlSeverity_t i_sev,
iv_termState(TERM_STATE_UNKNOWN)
{
// Collect the Backtrace and add it to the error log
- ErrlUserDetailsBackTrace().addToLog(this);
+ iv_pBackTrace = new ErrlUserDetailsBackTrace();
}
///////////////////////////////////////////////////////////////////////////////
@@ -75,6 +75,8 @@ ErrlEntry::~ErrlEntry()
delete (*l_itr);
}
+ delete iv_pBackTrace;
+ iv_pBackTrace = NULL;
}
///////////////////////////////////////////////////////////////////////////////
@@ -133,9 +135,9 @@ void ErrlEntry::appendToFFDC(ErrlUD * i_pErrlUD,
///////////////////////////////////////////////////////////////////////////////
// Return a Boolean indication of success.
-// Use these to tag the UD section containing the trace.
-const int FIPS_ERRL_UDT_TRACE = 0x0c;
-const int FIPS_ERRL_UDV_DEFAULT_VER_1 = 1;
+// Use these to tag the UD section containing the trace.
+const int FIPS_ERRL_UDT_TRACE = 0x0c;
+const int FIPS_ERRL_UDV_DEFAULT_VER_1 = 1;
bool ErrlEntry::collectTrace(const char i_name[], const uint64_t i_max)
{
@@ -209,6 +211,13 @@ bool ErrlEntry::collectTrace(const char i_name[], const uint64_t i_max)
return l_rc;
}
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+void ErrlEntry::removeBackTrace()
+{
+ delete iv_pBackTrace;
+ iv_pBackTrace = NULL;
+}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
@@ -272,6 +281,14 @@ void ErrlEntry::commit( compId_t i_committerComponent )
// User header contains the component ID of the committer.
iv_User.setComponentId( i_committerComponent );
+
+ // Add the captured backtrace to the error log
+ if (iv_pBackTrace)
+ {
+ iv_pBackTrace->addToLog(this);
+ delete iv_pBackTrace;
+ iv_pBackTrace = NULL;
+ }
}
OpenPOWER on IntegriCloud