本文整理匯總了C++中D_LOG函數的典型用法代碼示例。如果您正苦於以下問題:C++ D_LOG函數的具體用法?C++ D_LOG怎麽用?C++ D_LOG使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了D_LOG函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: cm__chan_foreach
/* call a callback function for each used channel */
BOOL
cm__chan_foreach(BOOL (*func)(), VOID *a1, VOID *a2)
{
INT n;
BOOL ret = TRUE;
D_LOG(D_ENTRY, ("cm__chan_foreach: entry, func: %lx, a1: 0x%lx, a2: 0x%lx", \
func, a1, a2));
for ( n = 0 ; n < MAX_CHAN_IN_SYSTEM ; n++ )
if ( chan_used[n] )
{
CM_CHAN *chan = chan_tbl + n;
D_LOG(D_ALWAYS, ("cm__chan_foreach: calling for chan# %d, channel: %lx", n, chan));
ret = (*func)(chan, a1, a2);
D_LOG(D_ALWAYS, ("cm__chan_foreach: returned %d", ret));
if ( !ret )
break;
}
return(ret);
}
示例2: cm__find_listen_conn
/* find a matching listening connection */
CM*
cm__find_listen_conn(CHAR *lname, CHAR *rname, CHAR *addr, VOID *Idd)
{
CM *cm;
ULONG n;
D_LOG(D_ENTRY, ("cm__find_listen_conn: entry, lname: [%s], rname: [%s], addr: [%s]", \
lname, rname, addr));
/* scan connection table */
for ( n = 0; n < MAX_CM_IN_SYSTEM ; n++)
{
cm = cm_tbl[n];
if ( cm_used[n] && (cm->idd == Idd) && (cm->state == CM_ST_LISTEN) )
{
D_LOG(D_ENTRY, ("cm__find_listen_conn: comparing to: name: [%s], remote_name: [%s]", \
cm->dprof.name, cm->dprof.remote_name));
if ( cm__match_str(cm->dprof.name, rname) &&
cm__match_str(cm->dprof.remote_name, lname) )
return(cm);
}
}
return(NULL);
}
示例3: VALIDATE_ARG_POINTER
cl_int MemoryObjectWrapper::createSubBuffer (cl_mem_flags aFlags,
RegionWrapper const& aRegion,
MemoryObjectWrapper** aResultOut) {
#if CL_WRAPPER_CL_VERSION_SUPPORT >= 110
D_METHOD_START;
cl_int err = CL_SUCCESS;
VALIDATE_ARG_POINTER (aResultOut, &err, err);
cl_buffer_region region;
region.origin = aRegion.origin;
region.size = aRegion.size;
cl_mem mem = clCreateSubBuffer (mWrapped, aFlags, CL_BUFFER_CREATE_TYPE_REGION,
(void const*)®ion, &err);
if (err != CL_SUCCESS || !mem)
D_LOG (LOG_LEVEL_ERROR, "clCreateSubBuffer failed. (error %d)", err);
// NOTE: clCreateSubBuffer can return an existing handle.
*aResultOut = MemoryObjectWrapper::getNewOrExisting (mem);
return err;
#else // CL_WRAPPER_CL_VERSION_SUPPORT >= 110
(void)aFlags; (void)aRegion; (void)aResultOut;
D_LOG (LOG_LEVEL_ERROR, "CLWrapper support for OpenCL 1.1 API was not enabled at build time.");
return CL_INVALID_VALUE;
#endif
}
示例4: direct_trap
void
direct_trap( const char *domain, int sig )
{
sigval_t val;
if (direct_config->delay_trap_ms) {
D_LOG( Direct_Trap, VERBOSE, "NOT RAISING signal %d from %s, waiting for %dms... attach gdb --pid=%d\n", sig, domain, direct_config->delay_trap_ms, getpid() );
direct_thread_sleep( direct_config->delay_trap_ms * 1000LL );
return;
}
D_LOG( Direct_Trap, VERBOSE, "Raising signal %d from %s...\n", sig, domain );
val.sival_int = direct_gettid();
#ifndef DIRECT_BUILD_NO_SIGQUEUE
sigqueue( direct_gettid(), sig, val );
#endif
// direct_tgkill( direct_getpid(), direct_gettid(), sig );
D_LOG( Direct_Trap, VERBOSE, "...tgkill(%d) on ourself returned, maybe blocked, calling abort()!\n", sig );
abort();
D_LOG( Direct_Trap, VERBOSE, "...abort() returned as well, calling %s()!\n",
#ifdef __NR_exit_group
"exit_group" );
syscall( __NR_exit_group, DR_BUG );
#else
"_exit" );
_exit( DR_BUG );
#endif
}
示例5: mtl_add_chan
/* add a channel to channel table */
mtl_add_chan(VOID *mtl_1, VOID *idd, USHORT bchan, ULONG speed, ULONG ConnectionType)
{
MTL *mtl = (MTL*)mtl_1;
INT ret = MTL_E_SUCC;
MTL_CHAN *chan;
INT n;
D_LOG(D_ENTRY, ("mtl_add_chan: entry, mtl: 0x%lx, idd: 0x%lx, bchan: %d, speed: 0x%x\n", \
mtl, idd, bchan, speed));
/* lock */
NdisAcquireSpinLock(&mtl->chan_tbl.lock);
/* check for space */
if ( mtl->chan_tbl.num >= MAX_CHAN_PER_CONN )
ret = MTL_E_NOROOM;
else
{
/* find free slot, MUST find! */
for ( chan = mtl->chan_tbl.tbl, n = 0 ; n < MAX_CHAN_PER_CONN ; n++, chan++ )
if ( !chan->idd )
break;
if ( n >= MAX_CHAN_PER_CONN )
{
D_LOG(DIGIMTL, ("mtl_add_chan: not free slot when num < MAX!\n"));
ret = MTL_E_NOROOM;
}
else
{
/* slot found, fill it */
mtl->chan_tbl.num++;
if (ConnectionType == CM_DKF)
{
mtl->IddTxFrameType = IDD_FRAME_DKF;
mtl->SendFramingBits = RAS_FRAMING;
}
else
{
mtl->IddTxFrameType = IDD_FRAME_PPP;
mtl->SendFramingBits = PPP_FRAMING;
}
chan->idd = idd;
chan->bchan = bchan;
chan->speed = speed;
chan->mtl = mtl;
/* add handler for slot */
idd_attach(idd, bchan, (VOID*)mtl__rx_bchan_handler, chan);
}
}
/* release & return */
NdisReleaseSpinLock(&mtl->chan_tbl.lock);
D_LOG(D_EXIT, ("mtl_add_chan: exit, ret: %d\n", ret));
return(ret);
}
示例6: mtl__rx_tick
/* do timer tick processing for rx side */
VOID
mtl__rx_tick(MTL *mtl)
{
INT n;
MTL_AS *as;
MTL_RX_TBL *RxTable = &mtl->rx_tbl;
//
// see if there are any receives to give to wrapper
//
IndicateRxToWrapper(mtl);
NdisAcquireSpinLock(&mtl->lock);
NdisAcquireSpinLock(&RxTable->lock);
/* scan assembly table */
for ( n = 0, as = RxTable->as_tbl ; n < MTL_RX_BUFS ; n++, as++ )
{
/* update ttl & check */
if ( as->tot && !(as->ttl -= 25) )
{
D_LOG(D_ALWAYS, ("mtl__rx_bchan_handler: Pkt Kill ttl = 0: Slot: %d, mtl: 0x%p", n, mtl));
D_LOG(D_ALWAYS, ("AS Timeout! mtl: 0x%p, as: 0x%p, as->seq: 0x%x", mtl, as, as->seq));
D_LOG(D_ALWAYS, ("as->tot: %d, as->num: %d", as->tot, as->num));
RxTable->TimeOutReceiveError1++;
//
// if this guy was queued for indication to wrapper
// and was not indicated within a second something is wrong
//
if (as->Queued)
{
D_LOG(D_ALWAYS, ("AS Timeout while queued for indication! mtl: 0x%p, as: 0x%p", mtl, as));
#if DBG
DbgBreakPoint();
#endif
}
as->tot = 0;
//
// mark this guy as being free
//
as->Queued = 0;
}
}
NdisReleaseSpinLock(&RxTable->lock);
NdisReleaseSpinLock(&mtl->lock);
}
示例7: mtl_get_mac_mtu
/* get mac mtu on connection */
mtl_get_mac_mtu(VOID *mtl_1, ULONG *mtu)
{
MTL *mtl = (MTL*)mtl_1;
D_LOG(D_ENTRY, ("mtl_get_mac_mtu: entry, mtl: 0x%lx, @mtu: 0x%lx\n", mtl, mtu));
*mtu = MTL_MAC_MTU;
D_LOG(D_EXIT, ("mtl_get_mac_mtu: exit, mtu: %ld\n", *mtu));
return(MTL_E_SUCC);
}
示例8: trc__cmd_handler
/* handler for trace and dump area data packets */
VOID
trc__cmd_handler(VOID *idd_1, USHORT chan, ULONG Reserved, IDD_MSG *msg)
{
TRC *trc;
TRC_ENTRY *ent;
IDD *idd = (IDD*)idd_1;
D_LOG(D_ENTRY, ("trc__cmd_handler: idd: %lx, chan: %d, msg: %lx", \
idd, chan, msg));
D_LOG(D_ENTRY, ("trc__cmd_handler: opcode: 0x%x, buflen: 0x%x, bufptr: %lx", \
msg->opcode, msg->buflen, msg->bufptr));
D_LOG(D_ENTRY, ("trc__cmd_handler: bufid: %lx, param: 0x%x", \
msg->bufid, msg->param));
// Get the trace object for this idd
trc = idd_get_trc(idd);
// if no obect exit
if (trc == NULL || msg->bufid >= 2)
return;
/* if here it is a trace frame. param is rx/tx attribute */
/* establish entry to insert into & update vars */
/* check if trace enabled */
if ( trc->stat.state == TRC_ST_STOP )
return;
D_LOG(D_ALWAYS, ("trc__cmd_handler: trc: %lx", trc));
/* check if frame filters in */
if ( !trc__filter(trc->stat.filter, msg->bufptr, msg->buflen) )
return;
/* frames needs to be buffered, establish entry pointer */
ent = trc->ent_tbl + trc->ent_put;
trc->ent_put = (trc->ent_put + 1) % trc->stat.depth;
if ( trc->ent_num < trc->stat.depth )
trc->ent_num++;
/* fill up entry */
ent->seq = trc->ent_seq++;
KeQuerySystemTime(&ent->time_stamp);
ent->attr = msg->bufid;
ent->org_len = msg->buflen;
ent->len = MIN(msg->buflen, sizeof(ent->data));
IddGetDataFromAdapter(idd,
(PUCHAR)ent->data,
(PUCHAR)msg->bufptr,
(USHORT)ent->len);
// NdisMoveMemory (ent->data, msg->bufptr, ent->len);
}
示例9: call_handlers
static void
call_handlers( int num,
void *addr )
{
DirectLink *l, *n;
if (num == SIG_DUMP_STACK)
num = DIRECT_SIGNAL_DUMP_STACK;
/* Loop through all handlers. */
direct_mutex_lock( &handlers_lock );
direct_list_foreach_safe (l, n, handlers) {
DirectSignalHandler *handler = (DirectSignalHandler*) l;
if (handler->removed) {
direct_list_remove( &handlers, &handler->link );
D_MAGIC_CLEAR( handler );
D_FREE( handler );
continue;
}
D_LOG( Direct_Signals, FATAL, " --> %d\n", handler->num );
if (handler->num != num && handler->num != DIRECT_SIGNAL_ANY)
continue;
if (handler->num == DIRECT_SIGNAL_ANY && num == DIRECT_SIGNAL_DUMP_STACK)
continue;
switch (handler->func( num, addr, handler->ctx )) {
case DSHR_OK:
break;
case DSHR_REMOVE:
direct_list_remove( &handlers, &handler->link );
D_MAGIC_CLEAR( handler );
D_FREE( handler );
break;
case DSHR_RESUME:
D_LOG( Direct_Signals, FATAL, " '-> cured!\n" );
direct_mutex_unlock( &handlers_lock );
return;
default:
D_BUG( "unknown result" );
break;
}
}
示例10: clSetUserEventStatus
cl_int EventWrapper::setUserEventStatus (cl_int aExecutionStatus) {
#if CL_WRAPPER_CL_VERSION_SUPPORT >= 110
D_METHOD_START;
cl_int err = clSetUserEventStatus (mWrapped, aExecutionStatus);
if (err != CL_SUCCESS) {
D_LOG (LOG_LEVEL_ERROR, " clSetUserEventStatus failed. (error %d)", err);
}
return err;
#else // CL_WRAPPER_CL_VERSION_SUPPORT >= 110
(void)aExecutionStatus;
D_LOG (LOG_LEVEL_ERROR, "CLWrapper support for OpenCL 1.1 API was not enabled at build time.");
return CL_INVALID_VALUE;
#endif
}
示例11: clGetGLObjectInfo
cl_int MemoryObjectWrapper::getGLObjectInfo (cl_gl_object_type *aGLObjectTypeOut,
cl_GLuint *aGLObjectNameOut) {
#ifdef CL_WRAPPER_ENABLE_OPENGL_SUPPORT
D_METHOD_START;
cl_int err = clGetGLObjectInfo (mWrapped, aGLObjectTypeOut, aGLObjectNameOut);
if (err != CL_SUCCESS)
D_LOG (LOG_LEVEL_ERROR, "clGetGLObjectInfo failed. (error %d)", err);
return err;
#else //CL_WRAPPER_ENABLE_OPENGL_SUPPORT
(void)aGLObjectTypeOut; (void)aGLObjectNameOut;
D_LOG (LOG_LEVEL_ERROR,
"CLWrapper support for OpenCL/OpenGL interoperability API was not enabled at build time.");
return CL_INVALID_VALUE;
#endif //CL_WRAPPER_ENABLE_OPENGL_SUPPORT
}
示例12: tlb_fill
/* XXX: fix it to restore all registers */
void tlb_fill(CPUCRISState *env1, target_ulong addr, int is_write, int mmu_idx,
uintptr_t retaddr)
{
TranslationBlock *tb;
CPUCRISState *saved_env;
int ret;
saved_env = env;
env = env1;
D_LOG("%s pc=%x tpc=%x ra=%p\n", __func__,
env->pc, env->debug1, (void *)retaddr);
ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx);
if (unlikely(ret)) {
if (retaddr) {
/* now we have a real cpu fault */
tb = tb_find_pc(retaddr);
if (tb) {
/* the PC is inside the translated code. It means that we have
a virtual CPU fault */
cpu_restore_state(tb, env, retaddr);
/* Evaluate flags after retranslation. */
helper_top_evaluate_flags();
}
}
cpu_loop_exit(env);
}
env = saved_env;
}
示例13: cm__chan_free
/* free a channel */
VOID
cm__chan_free(CM_CHAN *chan)
{
D_LOG(D_ENTRY, ("cm__chan_free: entry, chan: 0x%lx", chan));
chan_used[chan - chan_tbl] = FALSE;
}
示例14: ChannelInit
//
// Allocate free channel pool
//
VOID
ChannelInit(VOID)
{
NDIS_PHYSICAL_ADDRESS pa = NDIS_PHYSICAL_ADDRESS_CONST(-1, -1);
/* allocate memory object */
NdisAllocateMemory((PVOID*)&chan_tbl, sizeof(CM_CHAN) * MAX_CHAN_IN_SYSTEM, 0, pa);
if ( chan_tbl == NULL )
{
D_LOG(D_ALWAYS, ("ChannelInit: memory allocate failed!"));
return;
}
D_LOG(D_ALWAYS, ("ChannelInit: chan_tbl: 0x%x", chan_tbl));
NdisZeroMemory (chan_tbl, sizeof(CM_CHAN) * MAX_CHAN_IN_SYSTEM);
NdisZeroMemory (chan_used, sizeof(chan_used));
}
示例15: tlb_fill
/* XXX: fix it to restore all registers */
void tlb_fill (target_ulong addr, int is_write, int mmu_idx, void *retaddr)
{
TranslationBlock *tb;
CPUState *saved_env;
unsigned long pc;
int ret;
/* XXX: hack to restore env in all cases, even if not called from
generated code */
saved_env = env;
env = cpu_single_env;
D_LOG("%s pc=%x tpc=%x ra=%x\n", __func__,
env->pc, env->debug1, retaddr);
ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx, 1);
if (unlikely(ret)) {
if (retaddr) {
/* now we have a real cpu fault */
pc = (unsigned long)retaddr;
tb = tb_find_pc(pc);
if (tb) {
/* the PC is inside the translated code. It means that we have
a virtual CPU fault */
cpu_restore_state(tb, env, pc);
/* Evaluate flags after retranslation. */
helper_top_evaluate_flags();
}
}
cpu_loop_exit(env);
}
env = saved_env;
}