summaryrefslogtreecommitdiffstats
path: root/src/usr/trace
diff options
context:
space:
mode:
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