summaryrefslogtreecommitdiffstats
path: root/src/usr/trace
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-12-06 11:45:58 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-12-14 11:25:05 -0600
commit3e7277d17bdfa91ba4a1ce86f5b206ebe3ee2630 (patch)
tree2bab97dc5ed7b333193a77ffb4f20ae902482ba1 /src/usr/trace
parent950ddd853b2044956d82d17ae67bfe222e49fded (diff)
downloadtalos-hostboot-3e7277d17bdfa91ba4a1ce86f5b206ebe3ee2630.tar.gz
talos-hostboot-3e7277d17bdfa91ba4a1ce86f5b206ebe3ee2630.zip
ContTrace tool updates for new trace design.
Change-Id: I424ee37b29bf762b8f6a8be73ebbc2f19ba914aa Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2585 Tested-by: Jenkins Server Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/trace')
-rw-r--r--src/usr/trace/daemon/daemon.C14
-rw-r--r--src/usr/trace/debug.C30
-rw-r--r--src/usr/trace/debug.H53
-rw-r--r--src/usr/trace/makefile2
4 files changed, 97 insertions, 2 deletions
diff --git a/src/usr/trace/daemon/daemon.C b/src/usr/trace/daemon/daemon.C
index 2a98f70b5..fd426933a 100644
--- a/src/usr/trace/daemon/daemon.C
+++ b/src/usr/trace/daemon/daemon.C
@@ -27,6 +27,7 @@
#include "../bufferpage.H"
#include "../entry.H"
#include "../compdesc.H"
+#include "../debug.H"
#include <initservice/taskargs.H>
#include <initservice/initserviceif.H>
@@ -308,6 +309,9 @@ namespace TRACEDAEMON
void Daemon::sendContBuffer(void* i_buffer, size_t i_size)
{
+ // Write debug structure with buffer information.
+ g_debugSettings.bufferSize = i_size;
+ g_debugSettings.bufferPage = i_buffer;
// Write scratch register indicating continuous trace is available.
writeScratchReg(1ull << 32);
@@ -322,7 +326,14 @@ namespace TRACEDAEMON
TARGETING::SpFunctions spFunctions =
sys->getAttr<TARGETING::ATTR_SP_FUNCTIONS>();
- if (!spFunctions.traceContinuous)
+ // Determine if continuous trace is currently enabled.
+ bool contEnabled = spFunctions.traceContinuous;
+ if (g_debugSettings.contTraceOverride != 0)
+ {
+ contEnabled = (g_debugSettings.contTraceOverride == 2);
+ }
+
+ if (!contEnabled)
{
// Trace isn't enabled so just discard the buffer.
free(i_buffer);
@@ -341,6 +352,7 @@ namespace TRACEDAEMON
{
task_yield();
}
+ free(i_buffer);
}
}
}
diff --git a/src/usr/trace/debug.C b/src/usr/trace/debug.C
new file mode 100644
index 000000000..cc1856918
--- /dev/null
+++ b/src/usr/trace/debug.C
@@ -0,0 +1,30 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/trace/debug.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "debug.H"
+
+namespace TRACE
+{
+
+ DebugSettings g_debugSettings = { 0, 0, NULL };
+
+}
diff --git a/src/usr/trace/debug.H b/src/usr/trace/debug.H
new file mode 100644
index 000000000..c9a14f91e
--- /dev/null
+++ b/src/usr/trace/debug.H
@@ -0,0 +1,53 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/trace/debug.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __TRACE_DEBUG_H
+#define __TRACE_DEBUG_H
+
+#include <stdint.h>
+
+namespace TRACE
+{
+ /** @struct DebugSettings
+ *
+ * Settings and values used by the debug tools to interact with the
+ * trace component.
+ */
+ struct DebugSettings
+ {
+ // Continuous Trace:
+ /** Override of attribute setting.
+ * 0 - Use attribute (default).
+ * 1 - Force Disable
+ * 2 - Force Enable
+ */
+ uint8_t contTraceOverride;
+ /** Size of continuous trace buffer. */
+ uint16_t bufferSize;
+ /** Pointer to continuous trace buffer. */
+ void* bufferPage;
+ };
+
+ extern DebugSettings g_debugSettings;
+}
+
+#endif
diff --git a/src/usr/trace/makefile b/src/usr/trace/makefile
index 38de606aa..c58a11a4f 100644
--- a/src/usr/trace/makefile
+++ b/src/usr/trace/makefile
@@ -24,7 +24,7 @@ ROOTPATH = ../../..
MODULE = trace
OBJS = interface.o service.o compdesc.o buffer.o bufferpage.o daemonif.o \
- assert.o
+ debug.o assert.o
SUBDIRS = daemon.d test.d
OpenPOWER on IntegriCloud