summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/initservice/initserviceif.H5
-rw-r--r--src/usr/console/daemon.C2
-rw-r--r--src/usr/errl/errlmanager.C6
-rw-r--r--src/usr/initservice/baseinitsvc/initservice.C41
-rw-r--r--src/usr/initservice/baseinitsvc/initservice.H11
-rw-r--r--src/usr/intr/intrrp.C2
-rw-r--r--src/usr/ipmi/ipmirp.C9
-rw-r--r--src/usr/isteps/istep21/call_host_start_payload.C2
-rw-r--r--src/usr/mbox/mailboxsp.C3
-rw-r--r--src/usr/pnor/pnorrp.C7
-rw-r--r--src/usr/secureboot/trusted/trustedboot.C3
-rw-r--r--src/usr/trace/daemon/daemon.C6
12 files changed, 70 insertions, 27 deletions
diff --git a/src/include/usr/initservice/initserviceif.H b/src/include/usr/initservice/initserviceif.H
index c30570324..3e6d0bd4a 100644
--- a/src/include/usr/initservice/initserviceif.H
+++ b/src/include/usr/initservice/initserviceif.H
@@ -88,13 +88,16 @@ void registerBlock(void* i_vaddr, uint64_t i_size, BlockPriority i_priority);
/**
* @brief Register a service to be notified during shutdown
*
+ * @param[in] i_compID, component registering event
* @param[in] i_msgQ, A message queue to send a message to on shutdown
* @param[in] i_msgType, The message type to send.
* @param[in] i_priority, See EventPriority
+ *
* @return true - i_msgQ registered
* false - i_msgQ already registered. Not registered again.
*/
-bool registerShutdownEvent(msg_q_t i_msgQ,
+bool registerShutdownEvent(compId_t i_compID,
+ msg_q_t i_msgQ,
uint32_t i_msgType,
EventPriority_t i_priority = NO_PRIORITY);
diff --git a/src/usr/console/daemon.C b/src/usr/console/daemon.C
index 0887afc7c..1e8434827 100644
--- a/src/usr/console/daemon.C
+++ b/src/usr/console/daemon.C
@@ -61,7 +61,7 @@ namespace CONSOLE
{
// Detach and register daemon with shutdown path.
task_detach();
- INITSERVICE::registerShutdownEvent(g_msgq, SYNC,
+ INITSERVICE::registerShutdownEvent(CONSOLE_COMP_ID, g_msgq, SYNC,
INITSERVICE::CONSOLE_PRIORITY);
// Create a default output UART device if there isn't already one.
diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C
index d3dd871aa..1786b46b4 100644
--- a/src/usr/errl/errlmanager.C
+++ b/src/usr/errl/errlmanager.C
@@ -218,8 +218,10 @@ void ErrlManager::msgQueueInit ()
iv_msgQ = msg_q_create();
// Register for error log manager shutdown event
- INITSERVICE::registerShutdownEvent( iv_msgQ, ERRLOG_SHUTDOWN_TYPE,
- INITSERVICE::NO_PRIORITY );
+ INITSERVICE::registerShutdownEvent( ERRL_COMP_ID,
+ iv_msgQ,
+ ERRLOG_SHUTDOWN_TYPE,
+ INITSERVICE::NO_PRIORITY );
TRACFCOMP( g_trac_errl, EXIT_MRK "ErrlManager::msgQueueInit" );
return;
diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C
index a40317a30..3e89d3196 100644
--- a/src/usr/initservice/baseinitsvc/initservice.C
+++ b/src/usr/initservice/baseinitsvc/initservice.C
@@ -75,9 +75,18 @@ namespace SPLESS
namespace INITSERVICE
{
+trace_desc_t *g_trac_initsvc = nullptr;
-trace_desc_t *g_trac_initsvc = NULL;
-TRAC_INIT(&g_trac_initsvc, "INITSVC", 2*KILOBYTE );
+/**
+ * @brief Instantiates trace object for INITSVC traces (if necessary)
+ */
+void initTrace()
+{
+ if ( nullptr == g_trac_initsvc )
+ {
+ TRACE::TracInit l_tmp(&g_trac_initsvc, "INITSVC", 2*KILOBYTE );
+ }
+}
/**
* @brief start() task entry procedure
@@ -86,6 +95,8 @@ TRAC_INIT(&g_trac_initsvc, "INITSVC", 2*KILOBYTE );
extern "C"
void* _start(void *ptr)
{
+ initTrace(); // initialize trace descriptor for module start
+
TRACFCOMP( g_trac_initsvc,
"Executing Initialization Service module." );
@@ -619,6 +630,7 @@ InitService::InitService( ) :
iv_iStep( 0 ),
iv_iSubStep( 0 )
{
+ initTrace(); // Initialize trace descriptor for external interface
mutex_init(&iv_registryMutex);
}
@@ -876,7 +888,9 @@ void InitService::_doShutdown(uint64_t i_status,
(i->msgPriority <= LAST_PRE_MEM_FLUSH_PRIORITY));
++i)
{
- TRACFCOMP(g_trac_initsvc,"notify priority=0x%x, queue=0x%x", i->msgPriority, i->msgQ );
+ TRACFCOMP(g_trac_initsvc, "notify priority=0x%x, queue=0x%x, "
+ "msgType=0x%x, componentID=0x%x", i->msgPriority, i->msgQ,
+ i->msgType, i->compID );
l_msg->type = i->msgType;
l_msg->data[0] = iv_worst_status;
(void)msg_sendrecv(i->msgQ,l_msg);
@@ -968,7 +982,8 @@ void doShutdownWithError ( uint64_t i_status, uint32_t i_error_info)
}
-bool InitService::registerShutdownEvent(msg_q_t i_msgQ,
+bool InitService::registerShutdownEvent(compId_t i_compID,
+ msg_q_t i_msgQ,
uint32_t i_msgType,
EventPriority_t i_priority)
{
@@ -993,8 +1008,13 @@ bool InitService::registerShutdownEvent(msg_q_t i_msgQ,
if(result)
{
+ TRACFCOMP(g_trac_initsvc, "InitService::registerShutdownEvent: "
+ "componentID=0x%x, queue=0x%x, msgType=0x%x, priority=0x%x",
+ i_compID, i_msgQ, i_msgType, i_priority);
+
// add it to the queue, we'll sort it before sending
- iv_regMsgQ.push_back(regMsgQ_t(i_msgQ, i_msgType, i_priority));
+ iv_regMsgQ.push_back( regMsgQ_t(i_msgQ, i_msgType,
+ i_priority, i_compID) );
}
}
@@ -1019,6 +1039,11 @@ bool InitService::unregisterShutdownEvent(msg_q_t i_msgQ)
// erase all instances
if(r->msgQ == i_msgQ)
{
+ TRACFCOMP(g_trac_initsvc,
+ "InitService::unregisterShutdownEvent: "
+ "componentID=0x%x, queue=0x%x, msgType=0x%x, priority=0x%x",
+ r->compID, r->msgQ, r->msgType, r->msgPriority);
+
result = true;
iv_regMsgQ.erase(r);
}
@@ -1054,12 +1079,14 @@ void InitService::GetIstepData( uint8_t & o_step,
/**
* @see src/include/usr/initservice/initservicif.H
*/
-bool registerShutdownEvent(msg_q_t i_msgQ,
+bool registerShutdownEvent(compId_t i_compID,
+ msg_q_t i_msgQ,
uint32_t i_msgType,
EventPriority_t i_priority)
{
return
- Singleton<InitService>::instance().registerShutdownEvent(i_msgQ,
+ Singleton<InitService>::instance().registerShutdownEvent(i_compID,
+ i_msgQ,
i_msgType,
i_priority);
}
diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H
index c3b71584a..356b4b8f8 100644
--- a/src/usr/initservice/baseinitsvc/initservice.H
+++ b/src/usr/initservice/baseinitsvc/initservice.H
@@ -95,15 +95,18 @@ public:
msg_q_t msgQ;
uint32_t msgType;
uint32_t msgPriority;
+ compId_t compID;
/**
* @brief Constructor
*/
regMsgQ_t(msg_q_t i_msgQ,
uint32_t i_msgType,
- EventPriority_t i_priority) :
+ EventPriority_t i_priority,
+ compId_t i_compId) :
msgQ(i_msgQ), msgType(i_msgType),
- msgPriority((uint32_t)i_priority) {}
+ msgPriority((uint32_t)i_priority),
+ compID(i_compId) {}
// allow us to sort the queue based on priority
bool operator < (const regMsgQ_t &msg ) const
@@ -193,6 +196,7 @@ public:
/**
* @brief Register a service to be notified during shutdown
*
+ * @param[in] i_compID, component registering event
* @param[in] i_msgQ, A message queue to send a message to on shutdown
* @param[in] i_msgType, The message type to send.
* @param[in] i_priority, @See src/include/usr/initservice/initserviceif.H
@@ -200,7 +204,8 @@ public:
* @return true - i_msgQ registered
* false - i_msgQ already registered.- not registered again.
*/
- bool registerShutdownEvent(msg_q_t i_msgQ,
+ bool registerShutdownEvent(compId_t i_compID,
+ msg_q_t i_msgQ,
uint32_t i_msgType,
EventPriority_t i_priority);
diff --git a/src/usr/intr/intrrp.C b/src/usr/intr/intrrp.C
index 89a5baaed..70747d88f 100644
--- a/src/usr/intr/intrrp.C
+++ b/src/usr/intr/intrrp.C
@@ -484,7 +484,7 @@ errlHndl_t IntrRp::_init()
task_create(IntrRp::msg_handler, NULL);
// Register event to be called on shutdown
- INITSERVICE::registerShutdownEvent(iv_msgQ,
+ INITSERVICE::registerShutdownEvent(INTR_COMP_ID, iv_msgQ,
MSG_INTR_SHUTDOWN,
INITSERVICE::INTR_PRIORITY);
diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C
index 6b1138783..d58d627c4 100644
--- a/src/usr/ipmi/ipmirp.C
+++ b/src/usr/ipmi/ipmirp.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -464,7 +464,7 @@ void IpmiRP::handlePowerMessage( IPMI::oemSEL* i_event )
INITSERVICE::stopIpl();
// register for the post memory flush callback
- INITSERVICE::registerShutdownEvent(iv_msgQ,
+ INITSERVICE::registerShutdownEvent(IPMI_COMP_ID, iv_msgQ,
IPMI::MSG_STATE_GRACEFUL_SHUTDOWN,
INITSERVICE::POST_MEM_FLUSH_NOTIFY_LAST);
@@ -551,7 +551,8 @@ void IpmiRP::execute(void)
// as we don't want to accidentally get this message after
// interrupt processing has stopped in case we need intr to
// finish flushing the pipe.
- INITSERVICE::registerShutdownEvent(iv_msgQ, IPMI::MSG_STATE_SHUTDOWN,
+ INITSERVICE::registerShutdownEvent(IPMI_COMP_ID, iv_msgQ,
+ IPMI::MSG_STATE_SHUTDOWN,
INITSERVICE::MBOX_PRIORITY);
// Start the thread that waits for timeouts
@@ -710,7 +711,7 @@ void IpmiRP::execute(void)
iv_chassis_power_mod = IPMI::CHASSIS_POWER_RESET;
// register for the post memory flush callback
- INITSERVICE::registerShutdownEvent(iv_msgQ,
+ INITSERVICE::registerShutdownEvent(IPMI_COMP_ID, iv_msgQ,
IPMI::MSG_STATE_GRACEFUL_SHUTDOWN,
INITSERVICE::POST_MEM_FLUSH_NOTIFY_LAST);
diff --git a/src/usr/isteps/istep21/call_host_start_payload.C b/src/usr/isteps/istep21/call_host_start_payload.C
index 2d90e6b68..40febc4ac 100644
--- a/src/usr/isteps/istep21/call_host_start_payload.C
+++ b/src/usr/isteps/istep21/call_host_start_payload.C
@@ -443,7 +443,7 @@ errlHndl_t callShutdown ( uint64_t i_masterInstance,
{
// Register event to be called on shutdown
msg_q_t l_msgQ = msg_q_create();
- INITSERVICE::registerShutdownEvent(l_msgQ,
+ INITSERVICE::registerShutdownEvent(ISTEP_COMP_ID, l_msgQ,
MSG_PRE_SHUTDOWN_INITS,
INITSERVICE::PRESHUTDOWN_INIT_PRIORITY);
// Create a task to handle the messages
diff --git a/src/usr/mbox/mailboxsp.C b/src/usr/mbox/mailboxsp.C
index 00a158294..618db7538 100644
--- a/src/usr/mbox/mailboxsp.C
+++ b/src/usr/mbox/mailboxsp.C
@@ -211,7 +211,8 @@ errlHndl_t MailboxSp::_init()
MBOX::send(FSP_MAILBOX_MSGQ,msg);
// Register for shutdown
- INITSERVICE::registerShutdownEvent(iv_msgQ,
+ INITSERVICE::registerShutdownEvent(MBOX_COMP_ID,
+ iv_msgQ,
MSG_MBOX_SHUTDOWN,
INITSERVICE::MBOX_PRIORITY);
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C
index df88ba821..1df1f7001 100644
--- a/src/usr/pnor/pnorrp.C
+++ b/src/usr/pnor/pnorrp.C
@@ -280,9 +280,10 @@ void PnorRP::initDaemon()
// create a message queue
iv_msgQ = msg_q_create();
- INITSERVICE::registerShutdownEvent( iv_msgQ,
- PNOR::MSG_SHUTDOWN,
- INITSERVICE::PNOR_RP_PRIORITY);
+ INITSERVICE::registerShutdownEvent( PNOR_COMP_ID,
+ iv_msgQ,
+ PNOR::MSG_SHUTDOWN,
+ INITSERVICE::PNOR_RP_PRIORITY );
// create a Block, passing in the message queue
int rc = mm_alloc_block( iv_msgQ, (void*) BASE_VADDR, TOTAL_SIZE );
diff --git a/src/usr/secureboot/trusted/trustedboot.C b/src/usr/secureboot/trusted/trustedboot.C
index b62783eda..7b06c59c9 100644
--- a/src/usr/secureboot/trusted/trustedboot.C
+++ b/src/usr/secureboot/trusted/trustedboot.C
@@ -1435,7 +1435,8 @@ void* tpmDaemon(void* unused)
// Register shutdown events with init service.
// Done at the "end" of shutdown processing.
// This will flush any other messages (PCR extends) and terminate task
- INITSERVICE::registerShutdownEvent(systemData.msgQ,
+ INITSERVICE::registerShutdownEvent(TRBOOT_COMP_ID,
+ systemData.msgQ,
TRUSTEDBOOT::MSG_TYPE_SHUTDOWN);
Message* tb_msg = nullptr;
diff --git a/src/usr/trace/daemon/daemon.C b/src/usr/trace/daemon/daemon.C
index 8ebb24e74..a70ad2997 100644
--- a/src/usr/trace/daemon/daemon.C
+++ b/src/usr/trace/daemon/daemon.C
@@ -114,10 +114,12 @@ namespace TRACEDAEMON
// The one at the end will only be useful in non-FSP environments
// for continuous trace, because the mailbox is already shutdown.
//
- INITSERVICE::registerShutdownEvent(iv_service->iv_daemon->iv_queue,
+ INITSERVICE::registerShutdownEvent(TRACE_COMP_ID,
+ iv_service->iv_daemon->iv_queue,
DaemonIf::TRACE_DAEMON_SIGNAL,
INITSERVICE::HIGHEST_PRIORITY);
- INITSERVICE::registerShutdownEvent(iv_service->iv_daemon->iv_queue,
+ INITSERVICE::registerShutdownEvent(TRACE_COMP_ID,
+ iv_service->iv_daemon->iv_queue,
DaemonIf::TRACE_DAEMON_SIGNAL,
INITSERVICE::LOWEST_PRIORITY);
OpenPOWER on IntegriCloud