本文整理汇总了C++中OSM_LOG_ENTER函数的典型用法代码示例。如果您正苦于以下问题:C++ OSM_LOG_ENTER函数的具体用法?C++ OSM_LOG_ENTER怎么用?C++ OSM_LOG_ENTER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OSM_LOG_ENTER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: osm_pkt_randomizer_destroy
void
osm_pkt_randomizer_destroy(IN OUT osm_pkt_randomizer_t ** pp_pkt_randomizer,
IN osm_log_t * p_log)
{
OSM_LOG_ENTER(p_log);
if (*pp_pkt_randomizer != NULL) {
free((*pp_pkt_randomizer)->fault_dr_paths);
free(*pp_pkt_randomizer);
}
OSM_LOG_EXIT(p_log);
}
示例2: osm_vendor_destroy
/**********************************************************************
* DEALOCATE osm_vendor_t
**********************************************************************/
void osm_vendor_destroy(IN osm_vendor_t * const p_vend)
{
OSM_LOG_ENTER(p_vend->p_log);
osm_transaction_mgr_destroy(p_vend);
/* Destroy the poller threads */
/* HACK: can you destroy an un-initialized thread ? */
pthread_cancel(p_vend->smi_bind.poller.osd.id);
pthread_cancel(p_vend->gsi_bind.poller.osd.id);
cl_thread_destroy(&(p_vend->smi_bind.poller));
cl_thread_destroy(&(p_vend->gsi_bind.poller));
OSM_LOG_EXIT(p_vend->p_log);
}
示例3: osm_vendor_local_lid_change
/**********************************************************************
* the idea here is to change the content of the bind such that it
* will hold the local address used for sending directed route by the SMA.
**********************************************************************/
ib_api_status_t osm_vendor_local_lid_change(IN osm_bind_handle_t h_bind)
{
osm_vendor_t *p_vend = ((osm_ts_bind_info_t *) h_bind)->p_vend;
OSM_LOG_ENTER(p_vend->p_log);
osm_log(p_vend->p_log, OSM_LOG_DEBUG,
"osm_vendor_local_lid_change: DEBUG 2202: " "Change of LID.\n");
OSM_LOG_EXIT(p_vend->p_log);
return (IB_SUCCESS);
}
示例4: osm_vendor_get_ports
ib_api_status_t
osm_vendor_get_ports(IN osm_vendor_t * const p_vend,
IN ib_net64_t * const p_guids,
IN uint32_t * const num_guids)
{
OSM_LOG_ENTER(p_vend->p_log);
*p_guids = CL_NTOH64(0x0000000000001234);
*num_guids = 1;
OSM_LOG_EXIT(p_vend->p_log);
return (IB_SUCCESS);
}
示例5: mpr_rcv_get_end_points
static ib_net16_t mpr_rcv_get_end_points(IN osm_sa_t * sa,
IN const osm_madw_t * p_madw,
OUT osm_alias_guid_t ** pp_alias_guids,
OUT int *nsrc, OUT int *ndest)
{
const ib_multipath_rec_t *p_mpr;
const ib_sa_mad_t *p_sa_mad;
ib_net64_t comp_mask;
ib_net16_t sa_status = IB_SA_MAD_STATUS_SUCCESS;
ib_gid_t *gids;
OSM_LOG_ENTER(sa->p_log);
/*
Determine what fields are valid and then get a pointer
to the source and destination port objects, if possible.
*/
p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);
p_mpr = (ib_multipath_rec_t *) ib_sa_mad_get_payload_ptr(p_sa_mad);
gids = (ib_gid_t *) p_mpr->gids;
comp_mask = p_sa_mad->comp_mask;
/*
Check a few easy disqualifying cases up front before getting
into the endpoints.
*/
*nsrc = *ndest = 0;
if (comp_mask & IB_MPR_COMPMASK_SGIDCOUNT) {
*nsrc = p_mpr->sgid_count;
if (*nsrc > IB_MULTIPATH_MAX_GIDS)
*nsrc = IB_MULTIPATH_MAX_GIDS;
sa_status = mpr_rcv_get_gids(sa, gids, *nsrc, 1, pp_alias_guids);
if (sa_status != IB_SUCCESS)
goto Exit;
}
if (comp_mask & IB_MPR_COMPMASK_DGIDCOUNT) {
*ndest = p_mpr->dgid_count;
if (*ndest + *nsrc > IB_MULTIPATH_MAX_GIDS)
*ndest = IB_MULTIPATH_MAX_GIDS - *nsrc;
sa_status =
mpr_rcv_get_gids(sa, gids + *nsrc, *ndest, 0,
pp_alias_guids + *nsrc);
}
Exit:
OSM_LOG_EXIT(sa->p_log);
return sa_status;
}
示例6: OSM_LOG_ENTER
/* //////////////////////////////////////////////////////////////////////// */
ib_mad_t *osm_vendor_get(IN osm_bind_handle_t h_bind,
IN const uint32_t mad_size,
IN osm_vend_wrap_t * p_vend_wrap)
{
/* FSTATUS Status; */
/* uint32_t mad_count = 0; */
/* MadtStruct *p_madt_struct; */
mad_bind_info_t *p_mad_bind_info = (mad_bind_info_t *) h_bind;
umadt_obj_t *p_umadt_obj = p_mad_bind_info->p_umadt_obj;
ib_mad_t *p_mad;
OSM_LOG_ENTER(p_umadt_obj->p_log);
CL_ASSERT(h_bind);
p_umadt_obj = p_mad_bind_info->p_umadt_obj;
/* Sanity check */
CL_ASSERT(p_umadt_obj->init_done);
CL_ASSERT(p_vend_wrap);
CL_ASSERT(__valid_mad_handle(p_mad_bind_info));
#if 0
mad_count = 1;
Status =
p_umadt_obj->uMadtInterface.uMadtGetSendMad(p_mad_bind_info->
umadt_handle,
&mad_count,
&p_madt_struct);
if (Status != FSUCCESS || p_madt_struct == NULL) {
p_vend_wrap->p_madt_struct = NULL;
return NULL;
}
p_vend_wrap->p_madt_struct = p_madt_struct;
p_vend_wrap->direction = SEND;
return ((ib_mad_t *) & p_madt_struct->IBMad);
#endif /* 0 */
p_mad = (ib_mad_t *) malloc(mad_size);
if (!p_mad) {
p_vend_wrap->p_madt_struct = NULL;
return NULL;
}
memset(p_mad, 0, mad_size);
p_vend_wrap->p_madt_struct = NULL;
p_vend_wrap->direction = SEND;
p_vend_wrap->size = mad_size;
return (p_mad);
}
示例7: pi_rcv_process_switch_port0
/**********************************************************************
The plock must be held before calling this function.
**********************************************************************/
static void pi_rcv_process_switch_port0(IN osm_sm_t * sm,
IN osm_node_t * p_node,
IN osm_physp_t * p_physp,
IN ib_port_info_t * p_pi)
{
ib_api_status_t status;
osm_madw_context_t context;
uint8_t port, num_ports;
OSM_LOG_ENTER(sm->p_log);
if (p_physp->need_update)
sm->p_subn->ignore_existing_lfts = TRUE;
pi_rcv_check_and_fix_lid(sm->p_log, p_pi, p_physp);
/* Update the PortInfo attribute */
osm_physp_set_port_info(p_physp, p_pi, sm);
/* Determine if base switch port 0 */
if (p_node->sw &&
!ib_switch_info_is_enhanced_port0(&p_node->sw->switch_info))
/* PortState is not used on BSP0 but just in case it is DOWN */
p_physp->port_info = *p_pi;
/* Now, query PortInfo for the switch external ports */
num_ports = osm_node_get_num_physp(p_node);
context.pi_context.node_guid = osm_node_get_node_guid(p_node);
context.pi_context.port_guid = osm_physp_get_port_guid(p_physp);
context.pi_context.set_method = FALSE;
context.pi_context.light_sweep = FALSE;
context.pi_context.active_transition = FALSE;
context.pi_context.client_rereg = FALSE;
for (port = 1; port < num_ports; port++) {
status = osm_req_get(sm, osm_physp_get_dr_path_ptr(p_physp),
IB_MAD_ATTR_PORT_INFO, cl_hton32(port),
FALSE,
ib_port_info_get_m_key(&p_physp->port_info),
CL_DISP_MSGID_NONE, &context);
if (status != IB_SUCCESS)
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0F16: "
"Failure initiating PortInfo request (%s)\n",
ib_get_err_str(status));
}
pi_rcv_process_endport(sm, p_physp, p_pi);
OSM_LOG_EXIT(sm->p_log);
}
示例8: OSM_LOG_ENTER
/**********************************************************************
* Go over all remote SMs (as updated in the sm_guid_tbl).
* Find the one with the highest priority and lowest guid.
* Compare this SM to the local SM. If the local SM is higher -
* return NULL, if the remote SM is higher - return a pointer to it.
**********************************************************************/
static osm_remote_sm_t *state_mgr_get_highest_sm(IN osm_sm_t * sm)
{
cl_qmap_t *p_sm_tbl;
osm_remote_sm_t *p_sm = NULL;
osm_remote_sm_t *p_highest_sm;
uint8_t highest_sm_priority;
ib_net64_t highest_sm_guid;
osm_node_t *p_node;
OSM_LOG_ENTER(sm->p_log);
p_sm_tbl = &sm->p_subn->sm_guid_tbl;
/* Start with the local sm as the standard */
p_highest_sm = NULL;
highest_sm_priority = sm->p_subn->opt.sm_priority;
highest_sm_guid = sm->p_subn->sm_port_guid;
/* go over all the remote SMs */
for (p_sm = (osm_remote_sm_t *) cl_qmap_head(p_sm_tbl);
p_sm != (osm_remote_sm_t *) cl_qmap_end(p_sm_tbl);
p_sm = (osm_remote_sm_t *) cl_qmap_next(&p_sm->map_item)) {
/* If the sm is in NOTACTIVE state - continue */
if (ib_sminfo_get_state(&p_sm->smi) ==
IB_SMINFO_STATE_NOTACTIVE)
continue;
if (osm_sm_is_greater_than(ib_sminfo_get_priority(&p_sm->smi),
p_sm->smi.guid, highest_sm_priority,
highest_sm_guid)) {
/* the new p_sm is with higher priority - update the highest_sm */
/* to this sm */
p_highest_sm = p_sm;
highest_sm_priority =
ib_sminfo_get_priority(&p_sm->smi);
highest_sm_guid = p_sm->smi.guid;
}
}
if (p_highest_sm != NULL) {
p_node = osm_get_node_by_guid(sm->p_subn, p_highest_sm->smi.guid);
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Found higher SM with guid: %016" PRIx64 " (node %s)\n",
cl_ntoh64(p_highest_sm->smi.guid),
p_node ? p_node->print_desc : "UNKNOWN");
}
OSM_LOG_EXIT(sm->p_log);
return p_highest_sm;
}
示例9: osm_vendor_init
ib_api_status_t
osm_vendor_init(IN osm_vendor_t * const p_vend,
IN osm_log_t * const p_log, IN const uint32_t timeout)
{
OSM_LOG_ENTER(p_log);
CL_ASSERT(p_vend);
CL_ASSERT(p_log);
p_vend->p_log = p_log;
p_vend->timeout = timeout;
OSM_LOG_EXIT(p_log);
return (IB_SUCCESS);
}
示例10: osmt_unbind_inform_qp
/*
* Close the QP
*/
void
osmt_unbind_inform_qp(IN osmtest_t * const p_osmt, IN osmt_qp_ctx_t * p_qp_ctx)
{
osm_log_t *p_log = &p_osmt->log;
OSM_LOG_ENTER(p_log);
osmt_mtl_mad_cleanup(&p_qp_ctx->qp_bind_hndl);
IB_MGT_release_handle(p_qp_ctx->ib_mgt_qp0_handle);
OSM_LOG(p_log, OSM_LOG_DEBUG, "Unbind QP handles\n");
OSM_LOG_EXIT(&p_osmt->log);
}
示例11: osmv_txn_init
ib_api_status_t
osmv_txn_init(IN osm_bind_handle_t h_bind,
IN uint64_t tid, IN uint64_t key, OUT osmv_txn_ctx_t ** pp_txn)
{
ib_api_status_t st;
osmv_txn_ctx_t *p_txn;
osmv_bind_obj_t *p_bo = (osmv_bind_obj_t *) h_bind;
OSM_LOG_ENTER(p_bo->p_vendor->p_log);
CL_ASSERT(NULL != h_bind && NULL != pp_txn);
osm_log(p_bo->p_vendor->p_log, OSM_LOG_DEBUG,
"Starting transaction 0x%016" PRIx64
" (key=0x%016" PRIx64 ")\n", tid, key);
p_txn = malloc(sizeof(osmv_txn_ctx_t));
if (!p_txn) {
return IB_INSUFFICIENT_MEMORY;
}
memset(p_txn, 0, sizeof(osmv_txn_ctx_t));
p_txn->p_log = p_bo->txn_mgr.p_log;
p_txn->tid = tid;
p_txn->key = key;
p_txn->p_madw = NULL;
p_txn->rmpp_txfr.rmpp_state = OSMV_TXN_RMPP_NONE;
/* insert into transaction manager DB */
st = __osmv_txnmgr_insert_txn(&p_bo->txn_mgr, p_txn, key);
if (IB_SUCCESS != st) {
osm_log(p_bo->p_vendor->p_log, OSM_LOG_ERROR,
"osmv_txn_init: ERR 6703: "
"Failed to insert to transaction 0x%016" PRIx64
" (key=0x%016" PRIx64 ") to manager DB\n",
tid, key);
goto insert_txn_failed;
}
*pp_txn = p_txn;
OSM_LOG_EXIT(p_bo->p_vendor->p_log);
return IB_SUCCESS;
insert_txn_failed:
free(p_txn);
OSM_LOG_EXIT(p_bo->p_vendor->p_log);
return st;
}
示例12: state_mgr_is_sm_port_down
/**********************************************************************
Returns true if the SM port is down.
The SM's port object must exist in the port_guid table.
**********************************************************************/
static boolean_t state_mgr_is_sm_port_down(IN osm_sm_t * sm)
{
ib_net64_t port_guid;
osm_port_t *p_port;
osm_physp_t *p_physp;
uint8_t state;
OSM_LOG_ENTER(sm->p_log);
port_guid = sm->p_subn->sm_port_guid;
/*
* If we don't know our own port guid yet, assume the port is down.
*/
if (port_guid == 0) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3308: "
"SM port GUID unknown\n");
state = IB_LINK_DOWN;
goto Exit;
}
CL_ASSERT(port_guid);
CL_PLOCK_ACQUIRE(sm->p_lock);
p_port = osm_get_port_by_guid(sm->p_subn, port_guid);
if (!p_port) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3309: "
"SM port with GUID:%016" PRIx64 " is unknown\n",
cl_ntoh64(port_guid));
state = IB_LINK_DOWN;
CL_PLOCK_RELEASE(sm->p_lock);
goto Exit;
}
p_physp = p_port->p_physp;
CL_ASSERT(p_physp);
if (p_port->p_node->sw &&
!ib_switch_info_is_enhanced_port0(&p_port->p_node->sw->switch_info))
state = IB_LINK_ACTIVE; /* base SP0 */
else
state = osm_physp_get_port_state(p_physp);
CL_PLOCK_RELEASE(sm->p_lock);
Exit:
OSM_LOG_EXIT(sm->p_log);
return (state == IB_LINK_DOWN);
}
示例13: osm_lft_rcv_process
void osm_lft_rcv_process(IN void *context, IN void *data)
{
osm_sm_t *sm = context;
osm_madw_t *p_madw = data;
ib_smp_t *p_smp;
uint32_t block_num;
osm_switch_t *p_sw;
osm_lft_context_t *p_lft_context;
uint8_t *p_block;
ib_net64_t node_guid;
ib_api_status_t status;
CL_ASSERT(sm);
OSM_LOG_ENTER(sm->p_log);
CL_ASSERT(p_madw);
p_smp = osm_madw_get_smp_ptr(p_madw);
p_block = ib_smp_get_payload_ptr(p_smp);
block_num = cl_ntoh32(p_smp->attr_mod);
/*
Acquire the switch object for this switch.
*/
p_lft_context = osm_madw_get_lft_context_ptr(p_madw);
node_guid = p_lft_context->node_guid;
CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
p_sw = osm_get_switch_by_guid(sm->p_subn, node_guid);
if (!p_sw) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0401: "
"LFT received for nonexistent node "
"0x%" PRIx64 "\n", cl_ntoh64(node_guid));
} else {
status = osm_switch_set_lft_block(p_sw, p_block, block_num);
if (status != IB_SUCCESS) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0402: "
"Setting forwarding table block failed (%s)"
", Switch 0x%" PRIx64 " %s\n",
ib_get_err_str(status), cl_ntoh64(node_guid),
p_sw->p_node->print_desc);
}
}
CL_PLOCK_RELEASE(sm->p_lock);
OSM_LOG_EXIT(sm->p_log);
}
示例14: ni_rcv_process_existing_switch
/**********************************************************************
The plock must be held before calling this function.
**********************************************************************/
static void ni_rcv_process_existing_switch(IN osm_sm_t * sm,
IN osm_node_t * p_node,
IN const osm_madw_t * p_madw)
{
OSM_LOG_ENTER(sm->p_log);
/*
If this switch has already been probed during this sweep,
then don't bother reprobing it.
*/
if (p_node->discovery_count == 1)
ni_rcv_process_switch(sm, p_node, p_madw);
OSM_LOG_EXIT(sm->p_log);
}
示例15: __osm_vendor_internal_unbind
static void __osm_vendor_internal_unbind(osm_bind_handle_t h_bind)
{
osmv_bind_obj_t *p_bo = (osmv_bind_obj_t *) h_bind;
osm_log_t *p_log = p_bo->p_vendor->p_log;
OSM_LOG_ENTER(p_log);
/* "notifying" all that from now on no new sends can be done */
p_bo->txn_mgr.p_event_wheel->closing = TRUE;
osmv_txn_lock(p_bo);
/*
the is_closing is set under lock we we know we only need to
check for it after obtaining the lock
*/
p_bo->is_closing = TRUE;
/* notifying all sleeping rmpp sends to exit */
osmv_txn_abort_rmpp_txns(h_bind);
/* unlock the bo to allow for any residual mads to be dispatched */
osmv_txn_unlock(p_bo);
osm_log(p_log, OSM_LOG_DEBUG,
"__osm_vendor_internal_unbind: destroying transport mgr.. \n");
/* wait for the receiver thread to exit */
osmv_transport_done(h_bind);
/* lock to avoid any collissions while we cleanup the structs */
osmv_txn_lock(p_bo);
osm_log(p_log, OSM_LOG_DEBUG,
"__osm_vendor_internal_unbind: destroying txn mgr.. \n");
osmv_txnmgr_done(h_bind);
osm_log(p_log, OSM_LOG_DEBUG,
"__osm_vendor_internal_unbind: destroying bind lock.. \n");
osmv_txn_unlock(p_bo);
/*
we intentionally let the p_bo and its lock leak -
as we did not implement a way to track active bind handles provided to
the client - and the client might use them
cl_spinlock_destroy(&p_bo->lock);
free(p_bo);
*/
OSM_LOG_EXIT(p_log);
}