summaryrefslogtreecommitdiffstats
path: root/src/usr/trace
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2016-05-15 12:03:54 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-24 10:56:44 -0400
commitaa513a3a39202bcbc5294cd1ef6618ecbe151bf8 (patch)
tree03a13ac3ed32fe5d30027a25e1033912f5698cc0 /src/usr/trace
parent7e8f95823e071367bc17bb95113239324f06e5d5 (diff)
downloadtalos-hostboot-aa513a3a39202bcbc5294cd1ef6618ecbe151bf8.tar.gz
talos-hostboot-aa513a3a39202bcbc5294cd1ef6618ecbe151bf8.zip
FSPless continous tracing support
- Updated trace daemon to output trace buf addr, size to mbox scratch 1, 2 - Moved enable disable of continous trace to "istep" control - Updated istep tool to dump traces to file and commandline Change-Id: I2d9f48f5ed9878591ff9ab45fa18a98fc286ac1f RTC:127346 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24565 Tested-by: Jenkins Server Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: FSP CI Jenkins Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/trace')
-rw-r--r--src/usr/trace/daemon/daemon.C24
-rw-r--r--src/usr/trace/daemon/daemon.H11
-rw-r--r--src/usr/trace/daemonif.C13
-rw-r--r--src/usr/trace/daemonif.H11
-rw-r--r--src/usr/trace/interface.C14
-rw-r--r--src/usr/trace/service.C10
-rw-r--r--src/usr/trace/service.H9
7 files changed, 79 insertions, 13 deletions
diff --git a/src/usr/trace/daemon/daemon.C b/src/usr/trace/daemon/daemon.C
index d16a34653..447f25f55 100644
--- a/src/usr/trace/daemon/daemon.C
+++ b/src/usr/trace/daemon/daemon.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -115,7 +115,7 @@ namespace TRACEDAEMON
INITSERVICE::LOWEST_PRIORITY);
// Clear scratch register.
- writeScratchReg(0);
+ writeScratchReg(0, 0);
// Loop handling messages.
while (msg_t* msg = iv_service->iv_daemon->wait())
@@ -429,8 +429,6 @@ namespace TRACEDAEMON
// 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);
// Signal for simics.
asm volatile("mr 4, %0; mr 5, %1" ::
@@ -477,6 +475,10 @@ namespace TRACEDAEMON
}
else
{
+ // Write scratch register indicating is available.
+ writeScratchReg(reinterpret_cast<uint64_t>(i_buffer) << 32,
+ i_size << 32);
+
// Wait for tools to extract the buffer.
while(0 != readScratchReg())
{
@@ -775,19 +777,29 @@ namespace TRACEDAEMON
}
- void Daemon::writeScratchReg(uint64_t i_value)
+ void Daemon::writeScratchReg(uint64_t i_value1, uint64_t i_value2)
{
size_t l_size = sizeof(uint64_t);
errlHndl_t l_errl =
deviceWrite(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
- &i_value, l_size,
+ &i_value1, l_size,
DEVICE_SCOM_ADDRESS(MB_SCRATCH_REGISTER_1));
if (l_errl)
{
errlCommit(l_errl, TRACE_COMP_ID);
}
+
+ l_errl =
+ deviceWrite(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
+ &i_value2, l_size,
+ DEVICE_SCOM_ADDRESS(MB_SCRATCH_REGISTER_2));
+
+ if (l_errl)
+ {
+ errlCommit(l_errl, TRACE_COMP_ID);
+ }
}
uint64_t Daemon::readScratchReg()
diff --git a/src/usr/trace/daemon/daemon.H b/src/usr/trace/daemon/daemon.H
index c84ad50bb..4c7f369d5 100644
--- a/src/usr/trace/daemon/daemon.H
+++ b/src/usr/trace/daemon/daemon.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -96,9 +96,11 @@ namespace TRACEDAEMON
/** Locklessly move a trace entry from one location to another. */
void replaceEntry(TRACE::Entry* from, TRACE::Entry* to);
- /** Write mailbox scratch register to a value. */
- void writeScratchReg(uint64_t i_value);
- /** Read mailbox scratch register. */
+ /** Write mailbox scratch 1 & 2 registers to a values.
+ * scratch 1 contains the trace buffer address
+ * scratch 2 contains the trace buffer size */
+ void writeScratchReg(uint64_t i_value1, uint64_t i_value2);
+ /** Read mailbox scratch 1 register. */
uint64_t readScratchReg();
/** Client-service object. */
@@ -124,6 +126,7 @@ namespace TRACEDAEMON
/** Address of scratch register. */
static const uint32_t MB_SCRATCH_REGISTER_1 = 0x00050038;
+ static const uint32_t MB_SCRATCH_REGISTER_2 = 0x00050039;
};
diff --git a/src/usr/trace/daemonif.C b/src/usr/trace/daemonif.C
index 427b2c0bc..c6dd79219 100644
--- a/src/usr/trace/daemonif.C
+++ b/src/usr/trace/daemonif.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -64,4 +66,13 @@ namespace TRACE
}
}
+ void DaemonIf::continousMode(bool i_enable)
+ {
+ msg_t* msg = msg_allocate();
+ msg->type = TRACE_CONT_TRACE_STATE;
+ msg->data[0] = i_enable ? 0x1 : 0x0; //needs to be a zero/one
+ msg_sendrecv(iv_queue, msg);
+ msg_free(msg);
+ }
+
}
diff --git a/src/usr/trace/daemonif.H b/src/usr/trace/daemonif.H
index c9fca65d8..2fe45c432 100644
--- a/src/usr/trace/daemonif.H
+++ b/src/usr/trace/daemonif.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -64,6 +66,13 @@ namespace TRACE
*/
void signal(bool i_blocking = false);
+ /** Allows the client to turn on/off continous mode.
+ *
+ * @param[in] i_enable - Indicates if this function should enable
+ * or disable continous mode
+ */
+ void continousMode(bool i_enable);
+
friend class BufferTest;
friend class TRACEDAEMON::Daemon;
diff --git a/src/usr/trace/interface.C b/src/usr/trace/interface.C
index 134940185..c7856e712 100644
--- a/src/usr/trace/interface.C
+++ b/src/usr/trace/interface.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -117,6 +117,18 @@ namespace TRACE
Singleton<Service>::instance().flushBuffers();
}
+#ifndef __HOSTBOOT_RUNTIME
+ void enableContinousTrace()
+ {
+ Singleton<Service>::instance().enableContinous();
+ }
+
+ void disableContinousTrace()
+ {
+ Singleton<Service>::instance().disableContinous();
+ }
+#endif
+
bool isDebugEnabled(ComponentDesc * i_td)
{
return i_td->iv_debugEnabled;
diff --git a/src/usr/trace/service.C b/src/usr/trace/service.C
index d8039d9be..a3445c2ee 100644
--- a/src/usr/trace/service.C
+++ b/src/usr/trace/service.C
@@ -498,6 +498,16 @@ namespace TRACE
iv_daemon->signal(true);
}
+ void Service::enableContinous()
+ {
+ iv_daemon->continousMode(true);
+ }
+
+ void Service::disableContinous()
+ {
+ iv_daemon->continousMode(false);
+ }
+
Service* Service::getGlobalInstance()
{
return &(Singleton<Service>::instance());
diff --git a/src/usr/trace/service.H b/src/usr/trace/service.H
index 52cc81399..001242530 100644
--- a/src/usr/trace/service.H
+++ b/src/usr/trace/service.H
@@ -155,6 +155,15 @@ namespace TRACE
*/
uint8_t getTraceLite();
+#ifndef __HOSTBOOT_RUNTIME
+ /** @brief Enable Continous Trace mode (for FSPless)
+ */
+ void enableContinous();
+
+ /** @brief Disable Continous Trace mode (for FSPless)
+ */
+ void disableContinous();
+#endif
friend class TRACEDAEMON::Daemon;
private:
OpenPOWER on IntegriCloud