本文整理汇总了C++中TRACE_LEAVE函数的典型用法代码示例。如果您正苦于以下问题:C++ TRACE_LEAVE函数的具体用法?C++ TRACE_LEAVE怎么用?C++ TRACE_LEAVE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TRACE_LEAVE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: amf_standby_state_handler
/****************************************************************************
* Name : amf_standby_state_handler
*
* Description : This function is called upon receving an standby state
* assignment from AMF.
*
* Arguments : invocation - Designates a particular invocation.
* cb - A pointer to the LGS control block.
*
* Return Values : None
*
* Notes : None
*****************************************************************************/
static SaAisErrorT amf_standby_state_handler(lgs_cb_t *cb, SaInvocationT invocation)
{
SaAisErrorT error = SA_AIS_OK;
TRACE_ENTER2("HA STANDBY request");
cb->ha_state = SA_AMF_HA_STANDBY;
cb->mds_role = V_DEST_RL_STANDBY;
TRACE_LEAVE();
return error;
}
示例2: dtm_prepare_data_msg
/**
* Function to prepare the data message
*
* @param buffer len
*
* @return NCSCC_RC_SUCCESS
* @return NCSCC_RC_FAILURE
*
*/
uint32_t dtm_prepare_data_msg(uint8_t *buffer, uint16_t len)
{
uint8_t *data = buffer;
TRACE_ENTER();
ncs_encode_16bit(&data, (len - 2));
ncs_encode_32bit(&data, (uint32_t)DTM_INTERNODE_SND_MSG_IDENTIFIER);
ncs_encode_8bit(&data, (uint8_t)DTM_INTERNODE_SND_MSG_VER);
ncs_encode_8bit(&data, DTM_MESSAGE_MSG_TYPE);
/* Remaining data already in buffer */
TRACE_LEAVE();
return NCSCC_RC_SUCCESS;
}
示例3: saSmfCallbackScopeUnregister
/***************************************************************************
@brief : saSmfCallbackScopeUnregister. No cbk will be called for
the client after successful retutn of this api.
@param[in] : smfHandle - Handle returned by successful intialize.
@param[in] : scopeId - Filters for this scope id will be unregistered.
inv id is to be passed in the response.
@return : SA_AIS_OK if successful otherwise appropiate err code.
*****************************************************************************/
SaAisErrorT saSmfCallbackScopeUnregister( SaSmfHandleT smfHandle,
SaSmfCallbackScopeIdT scopeId)
{
SMFA_CB *cb = &_smfa_cb;
SMFA_CLIENT_INFO *client_info;
TRACE_ENTER2("Handle: %llu, Scope: %u.",smfHandle,scopeId);
if (cb->is_finalized){
LOG_ER("SMFA: Already finalized, Bad handle %llu.",smfHandle);
TRACE_LEAVE();
return SA_AIS_ERR_BAD_HANDLE;
}
if (NCSCC_RC_SUCCESS != m_NCS_LOCK(&cb->cb_lock,NCS_LOCK_WRITE)){
LOG_ER("SMFA: Cb lock acquire FAILED.");
TRACE_LEAVE();
return SA_AIS_ERR_NO_RESOURCES;
}
/* Get the client info structure for the handle.*/
client_info = smfa_client_info_get(smfHandle);
if (NULL == client_info){
LOG_ER("SMFA: Bad handle.");
m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
TRACE_LEAVE();
return SA_AIS_ERR_BAD_HANDLE;
}
/* Check if the scope id exists. Remove if exists otherwise return NOT_EXIST.*/
if (NCSCC_RC_FAILURE == smfa_scope_info_rmv(client_info,scopeId)){
LOG_ER("SMFA: Scope id %x does not exist",scopeId);
m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
TRACE_LEAVE();
return SA_AIS_ERR_NOT_EXIST;
}
m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
TRACE_LEAVE();
return SA_AIS_OK;
}
示例4: amf_active_state_handler
/****************************************************************************
* Name : amf_active_state_handler
*
* Description : This function is called upon receiving an active state
* assignment from AMF.
*
* Arguments : invocation - Designates a particular invocation.
* cb - A pointer to the LGS control block.
*
* Return Values : None
*
* Notes : None
*****************************************************************************/
static SaAisErrorT amf_active_state_handler(lgs_cb_t *cb, SaInvocationT invocation)
{
log_stream_t *stream;
SaAisErrorT error = SA_AIS_OK;
TRACE_ENTER2("HA ACTIVE request");
if (cb->ha_state == SA_AMF_HA_ACTIVE) {
/* State change was already processed in RDA callback */
goto done;
}
/* switch over, become implementer
*/
immutilWrapperProfile.nTries = 250; /* LOG will be blocked until IMM responds */
immutilWrapperProfile.errorsAreFatal = 0;
if ((error = immutil_saImmOiImplementerSet(lgs_cb->immOiHandle, "safLogService"))
!= SA_AIS_OK) {
LOG_ER("saImmOiClassImplementerSet (safLogService) failed: %d", error);
goto done;
}
if ((error = immutil_saImmOiClassImplementerSet(lgs_cb->immOiHandle,
"SaLogStreamConfig")) != SA_AIS_OK) {
LOG_ER("saImmOiClassImplementerSet (SaLogStreamConfig) failed: %d", error);
goto done;
}
/* Do this only if the class exists */
if (*(bool*) lgs_imm_logconf_get(LGS_IMM_LOG_OPENSAFLOGCONFIG_CLASS_EXIST, NULL)) {
if ((error = immutil_saImmOiClassImplementerSet(cb->immOiHandle, "OpenSafLogConfig"))
!= SA_AIS_OK) {
LOG_ER("saImmOiClassImplementerSet (OpenSafLogConfig) failed: %d", error);
goto done;
}
}
/* check existing streams */
stream = log_stream_getnext_by_name(NULL);
if (!stream)
LOG_ER("No streams exist!");
while (stream != NULL) {
*stream->p_fd = -1; /* First Initialize fd */
stream = log_stream_getnext_by_name(stream->name);
}
done:
immutilWrapperProfile.nTries = 20; /* Reset retry time to more normal value. */
immutilWrapperProfile.errorsAreFatal = 1;
/* Update role independent of stream processing */
lgs_cb->mds_role = V_DEST_RL_ACTIVE;
TRACE_LEAVE();
return error;
}
示例5: TRACE_ENTER
/****************************************************************************
* Name : cpnd_ckpt_sec_get
*
* Description : Function to Find the section in a checkpoint.
*
* Arguments : CPND_CKPT_NODE *cp_node - Check point node.
* : SaCkptSectionIdT id - Section Identifier
*
* Return Values : NULL/CPND_CKPT_SECTION_INFO
*
* Notes : None.
*****************************************************************************/
CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get(CPND_CKPT_NODE *cp_node, SaCkptSectionIdT *id)
{
CPND_CKPT_SECTION_INFO *pSecPtr = NULL;
TRACE_ENTER();
if (cp_node->replica_info.n_secs == 0) {
TRACE_4("cpnd replica has no section for ckpt_id:%llx",cp_node->ckpt_id);
TRACE_LEAVE();
return NULL;
}
pSecPtr = cp_node->replica_info.section_info;
while (pSecPtr != NULL) {
if ((pSecPtr->sec_id.idLen == id->idLen) && (memcmp(pSecPtr->sec_id.id, id->id, id->idLen) == 0)) {
return pSecPtr;
}
pSecPtr = pSecPtr->next;
}
TRACE_LEAVE();
return NULL;
}
示例6: eds_process_api_evt
/****************************************************************************
* Name : eds_process_api_evt
*
* Description : This is the function which is called when eds receives an
* event either because of an API Invocation or other internal
* messages from EDA clients
*
* Arguments : evt - Message that was posted to the EDS Mail box.
*
* Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
*
* Notes : None.
*****************************************************************************/
static uint32_t eds_process_api_evt(EDSV_EDS_EVT *evt)
{
TRACE_ENTER();
if (evt->evt_type == EDSV_EDS_EDSV_MSG) {
if ((evt->info.msg.type >= EDSV_BASE_MSG) && (evt->info.msg.type < EDSV_MSG_MAX)) {
if (eds_edsv_evt_dispatch_tbl[evt->info.msg.type] (evt) != NCSCC_RC_SUCCESS) {
}
}
}
TRACE_LEAVE();
return NCSCC_RC_SUCCESS;
}
示例7: dtm_internode_snd_msg_to_node
/**
* Fucntion to send internode message
*
* @param node_id buffer len
*
* @return NCSCC_RC_SUCCESS
* @return NCSCC_RC_FAILURE
*
*/
uns32 dtm_internode_snd_msg_to_node(uns8 *buffer, uns16 len, NODE_ID node_id)
{
DTM_NODE_DB *node = NULL;
TRACE_ENTER();
node = dtm_node_get_by_id(node_id);
if (NULL != node) {
if (NCSCC_RC_SUCCESS != dtm_internode_snd_msg_common(node, buffer, len)) {
free(buffer);
TRACE_LEAVE();
return NCSCC_RC_FAILURE;
}
} else {
free(buffer);
TRACE_LEAVE();
return NCSCC_RC_FAILURE;
}
/* Get the node entry and send message */
TRACE_LEAVE();
return NCSCC_RC_SUCCESS;
}
示例8: sendLoggedConfirmUpdate
void sendLoggedConfirmUpdate(SaNtfIdentifierT notificationId)
{
ntfsv_ckpt_msg_t ckpt;
TRACE_ENTER2("notId: %llu", notificationId);
memset(&ckpt, 0, sizeof(ckpt));
ckpt.header.ckpt_rec_type = NTFS_CKPT_NOT_LOG_CONFIRM;
ckpt.header.num_ckpt_records = 1;
ckpt.header.data_len = 1;
ckpt.ckpt_rec.log_confirm.notificationId = notificationId;
update_standby(&ckpt, NCS_MBCSV_ACT_ADD);
TRACE_LEAVE();
}
示例9: amf_csi_set_callback
/****************************************************************************
* Name : amf_csi_set_callback
*
* Description : AMF callback function called
* when there is any change in the HA state.
*
* Arguments : invocation - This parameter designated a particular
* invocation of this callback function. The
* invoke process return invocation when it
* responds to the Avilability Management
* FrameWork using the saAmfResponse()
* function.
* compName - A pointer to the name of the component
* whose readiness stae the Availability
* Management Framework is setting.
* haState - The new HA state to be assumeb by the
* component service instance identified by
* csiName.
* csiDescriptor - This will indicate whether or not the
* component service instance for
* ativeCompName went through quiescing.
*
* Return Values : None.
*
* Notes : None.
*****************************************************************************/
static void amf_csi_set_callback(SaInvocationT invocation,
const SaNameT * compName, SaAmfHAStateT new_haState, SaAmfCSIDescriptorT csiDescriptor)
{
SaAisErrorT result = SA_AIS_OK;
TRACE_ENTER();
/* Nothing to be done. We are always active */
smfnd_cb->ha_state = new_haState;
saAmfResponse(smfnd_cb->amf_hdl, invocation, result);
TRACE_LEAVE();
}
示例10: avnd_int_ext_comp_val
/******************************************************************************
Name : avnd_int_ext_comp_val
Description : This routine checks for int/ext comp.
Arguments : cb - ptr to the AvND control block.
api_info - ptr to the api info structure.
ctxt - ptr to mds context information.
o_amf_rc - ptr to the amf-rc (o/p).
Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
Notes : None
******************************************************************************/
uns32 avnd_int_ext_comp_val(AVND_CB *cb, SaNameT *comp_name, AVND_COMP **o_comp, SaAisErrorT *o_amf_rc)
{
uns32 res = NCSCC_RC_SUCCESS;
*o_amf_rc = SA_AIS_OK;
TRACE_ENTER2("%s",comp_name->value);
if (0 == (*o_comp = m_AVND_INT_EXT_COMPDB_REC_GET(cb->internode_avail_comp_db, *comp_name))) {
return NCSCC_RC_FAILURE;
} else {
/* This means that this is an internode component. But need to check wether
it is a proxy for external component. If it is, then we shouldn't treat
it as an external component though it is in internode DB. This is bz of
a proxy on Ctrl is proxying external component. */
if (m_AVND_PROXY_IS_FOR_EXT_COMP(*o_comp)){
TRACE_LEAVE();
return NCSCC_RC_FAILURE;
}
}
TRACE_LEAVE();
return res;
}
示例11: plma_mds_register
/***********************************************************************//**
* @brief This routine registers the PLMA with MDS.
*
* @return NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
***************************************************************************/
uint32_t plma_mds_register()
{
uint32_t rc = NCSCC_RC_SUCCESS;
NCSMDS_INFO svc_info;
MDS_SVC_ID svc_id[1] = { NCSMDS_SVC_ID_PLMS};
PLMA_CB *plma_cb = plma_ctrlblk;
TRACE_ENTER();
/* STEP 1: the MDS handle for PLMA*/
rc = plma_mds_get_handle();
if (NCSCC_RC_SUCCESS != rc) {
LOG_ER("PLMA - mds get handle failed");
return rc;
}
/* STEP 2 : Install with MDS with service ID NCSMDS_SVC_ID_PLMA. */
memset(&svc_info, 0, sizeof(NCSMDS_INFO));
svc_info.i_mds_hdl = plma_cb->mds_hdl;
svc_info.i_svc_id = NCSMDS_SVC_ID_PLMA;
svc_info.i_op = MDS_INSTALL;
svc_info.info.svc_install.i_yr_svc_hdl = 0;
svc_info.info.svc_install.i_install_scope = NCSMDS_SCOPE_NONE; /*node specific */
svc_info.info.svc_install.i_svc_cb = plma_mds_callback; /* callback */
svc_info.info.svc_install.i_mds_q_ownership = false;
/***************************FIXME : MDS svc private sub part ver no?.**/
svc_info.info.svc_install.i_mds_svc_pvt_ver = PLMA_MDS_PVT_SUBPART_VERSION;
if (ncsmds_api(&svc_info) == NCSCC_RC_FAILURE) {
LOG_ER("PLMA - MDS Install Failed");
return NCSCC_RC_FAILURE;
}
/* STEP 3 : Subscribe to PLMS up/down events */
memset(&svc_info, 0, sizeof(NCSMDS_INFO));
svc_info.i_mds_hdl = plma_cb->mds_hdl;
svc_info.i_svc_id = NCSMDS_SVC_ID_PLMA;
svc_info.i_op = MDS_SUBSCRIBE;
svc_info.info.svc_subscribe.i_num_svcs = 1;
svc_info.info.svc_subscribe.i_scope = NCSMDS_SCOPE_NONE;
svc_info.info.svc_subscribe.i_svc_ids = svc_id;
if (ncsmds_api(&svc_info) == NCSCC_RC_FAILURE) {
LOG_ER("PLMA - MDS Subscribe for PLMS up/down Failed");
plma_mds_unregister();
return NCSCC_RC_FAILURE;
}
TRACE_LEAVE();
return rc;
}
示例12: plms_hrb_initialize
/***********************************************************************
* Name : plms_hrb_initialize
*
* Description : This function initializes the HRB control block
* and creates plms_hrb thread, It registers to MDS
* to receive requests from PLMS
*
* Arguments :
*
* Return Values : NCSCC_RC_SUCCESS
* NCSCC_RC_FAILURE
***********************************************************************/
SaUint32T plms_hrb_initialize()
{
PLMS_HRB_CB *cb = hrb_cb;
pthread_t thread_id;
pthread_attr_t attr;
struct sched_param thread_priority;
SaUint32T policy;
SaUint32T rc;
TRACE_ENTER();
/* create the mail box and attach it */
if ((rc = m_NCS_IPC_CREATE(&cb->mbx)) != NCSCC_RC_SUCCESS){
LOG_ER("error creating mail box err val:%d",rc);
return NCSCC_RC_FAILURE;
}
if ((rc = m_NCS_IPC_ATTACH(&cb->mbx)) != NCSCC_RC_SUCCESS){
LOG_ER("error attaching mail box err val:%d",rc);
return NCSCC_RC_FAILURE;
}
/* Initialize with the MDS */
if(hrb_mds_initialize() != NCSCC_RC_SUCCESS){
LOG_ER("HRB: mds initialization failed");
return NCSCC_RC_FAILURE;
}
/* Initialize thread attribute */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&attr, PLMS_HRB_STACKSIZE);
/* Create PLMS_HRB thread */
rc = pthread_create(&thread_id, &attr, plms_hrb, NULL);
if(rc){
LOG_ER("pthread_create FAILED ret code:%d error:%s",
rc,strerror(errno));
return NCSCC_RC_FAILURE;
}
/*scheduling parameters of the thread */
memset(&thread_priority, 0, sizeof(thread_priority));
thread_priority.sched_priority = PLMS_HRB_TASK_PRIORITY;
policy = SCHED_OTHER;
pthread_setschedparam(thread_id, policy, &thread_priority);
TRACE_LEAVE();
return NCSCC_RC_SUCCESS;
}
示例13: TRACE_ENTER
/****************************************************************************
Name : avnd_pgdb_mem_rec_add
Description : This routine adds/modifies a PG member record to/in the PG
record.
Arguments : cb - ptr to the AvND control block
pg - ptr to the pg rec
mem_info - ptr to the member info
Return Values : ptr to the pg member rec, if successful
0, otherwise
Notes : None.
******************************************************************************/
AVND_PG_MEM *avnd_pgdb_mem_rec_add(AVND_CB *cb, AVND_PG *pg, SaAmfProtectionGroupNotificationT *mem_info)
{
AVND_PG_MEM *pg_mem = 0;
TRACE_ENTER();
/* get the mem rec */
pg_mem = m_AVND_PGDB_MEM_REC_GET(*pg, mem_info->member.compName);
if (!pg_mem) {
/* a new record.. alloc & link it to the dll */
pg_mem = calloc(1, sizeof(AVND_PG_MEM));
if (!pg_mem)
goto err;
/* a fresh rec.. mark this member as a new addition */
pg_mem->info.change = mem_info->change;
/* update the record key */
pg_mem->info.member.compName = mem_info->member.compName;
pg_mem->pg_dll_node.key = (uns8 *)&pg_mem->info.member.compName;
/* add to the dll */
if (NCSCC_RC_SUCCESS != ncs_db_link_list_add(&pg->mem_list, &pg_mem->pg_dll_node))
goto err;
} else
pg_mem->info.change = SA_AMF_PROTECTION_GROUP_STATE_CHANGE;
/* update other params */
pg_mem->info.member = mem_info->member;
TRACE_LEAVE();
return pg_mem;
err:
if (pg_mem)
free(pg_mem);
TRACE_LEAVE();
return 0;
}
示例14: cpd_amf_comp_terminate_callback
/****************************************************************************
* Name : cpd_amf_comp_terminate_callback
*
* Description : This function SAF callback function which will be called
* when the AMF framework needs to terminate GLSV. This does
* all required to destroy GLSV(except to unregister from AMF)
*
* Arguments : invocation - This parameter designated a particular
* invocation of this callback function. The
* invoke process return invocation when it
* responds to the Avilability Management
* FrameWork using the saAmfResponse()
* function.
* compName - A pointer to the name of the component
* whose readiness stae the Availability
* Management Framework is setting.
*
* Return Values : None
*
* Notes : At present we are just support a simple liveness check.
*****************************************************************************/
void cpd_amf_comp_terminate_callback(SaInvocationT invocation, const SaNameT *compName)
{
CPD_CB *cb = 0;
SaAisErrorT saErr = SA_AIS_OK;
TRACE_ENTER();
cb = ncshm_take_hdl(NCS_SERVICE_ID_CPD, gl_cpd_cb_hdl);
if (cb) {
saAmfResponse(cb->amf_hdl, invocation, saErr);
ncshm_give_hdl(cb->cpd_hdl);
}
LOG_NO("Received AMF component terminate callback, exiting");
TRACE_LEAVE();
exit(0);
}
示例15: saImmOiCcbAbortCallback
/**
* Free saved (allocated) CCB data
*
*/
static void saImmOiCcbAbortCallback(SaImmOiHandleT immOiHandle, SaImmOiCcbIdT ccbId)
{
struct CcbUtilCcbData *ccbUtilCcbData;
TRACE_ENTER();
if ((ccbUtilCcbData = ccbutil_findCcbData(ccbId)) != NULL) {
ccbutil_deleteCcbData(ccbUtilCcbData);
} else {
LOG_ER("%s: Failed to find CCB object for ccb Id %llu",__FUNCTION__, ccbId);
}
TRACE_LEAVE();
}