当前位置: 首页>>代码示例>>C++>>正文


C++ D_DEBUG函数代码示例

本文整理汇总了C++中D_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ D_DEBUG函数的具体用法?C++ D_DEBUG怎么用?C++ D_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了D_DEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cont_open

static int
cont_open(struct rdb_tx *tx, struct ds_pool_hdl *pool_hdl, struct cont *cont,
	  crt_rpc_t *rpc)
{
	struct cont_open_in    *in = crt_req_get(rpc);
	daos_iov_t		key;
	daos_iov_t		value;
	struct container_hdl	chdl;
	int			rc;

	D_DEBUG(DF_DSMS, DF_CONT": processing rpc %p: hdl="DF_UUID" capas="
		DF_X64"\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->coi_op.ci_uuid), rpc,
		DP_UUID(in->coi_op.ci_hdl), in->coi_capas);

	/* Verify the pool handle capabilities. */
	if ((in->coi_capas & DAOS_COO_RW) &&
	    !(pool_hdl->sph_capas & DAOS_PC_RW) &&
	    !(pool_hdl->sph_capas & DAOS_PC_EX))
		D_GOTO(out, rc = -DER_NO_PERM);

	/* See if this container handle already exists. */
	daos_iov_set(&key, in->coi_op.ci_hdl, sizeof(uuid_t));
	daos_iov_set(&value, &chdl, sizeof(chdl));
	rc = rdb_tx_lookup(tx, &cont->c_svc->cs_hdls, &key, &value);
	if (rc != -DER_NONEXIST) {
		if (rc == 0 && chdl.ch_capas != in->coi_capas) {
			D_ERROR(DF_CONT": found conflicting container handle\n",
				DP_CONT(cont->c_svc->cs_pool_uuid,
					cont->c_uuid));
			rc = -DER_EXIST;
		}
		D_GOTO(out, rc);
	}

	rc = cont_open_bcast(rpc->cr_ctx, cont, in->coi_op.ci_pool_hdl,
			     in->coi_op.ci_hdl, in->coi_capas);
	if (rc != 0)
		D_GOTO(out, rc);

	/* TODO: Rollback cont_open_bcast() on errors from now on. */

	uuid_copy(chdl.ch_pool_hdl, pool_hdl->sph_uuid);
	uuid_copy(chdl.ch_cont, cont->c_uuid);
	chdl.ch_capas = in->coi_capas;

	rc = ds_cont_epoch_init_hdl(tx, cont, in->coi_op.ci_hdl, &chdl);
	if (rc != 0)
		D_GOTO(out, rc);

	rc = rdb_tx_update(tx, &cont->c_svc->cs_hdls, &key, &value);

out:
	D_DEBUG(DF_DSMS, DF_CONT": replying rpc %p: %d\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->coi_op.ci_uuid), rpc,
		rc);
	return rc;
}
开发者ID:daos-stack,项目名称:daos,代码行数:58,代码来源:srv_container.c

示例2: handle_client

static int handle_client(int cfd, int opmode)
{
	struct sockaddr_in sa;
	socklen_t salen;
	char buf[8192];
	int bufsize = sizeof(buf);
	int retval;

	memset(&sa, 0, sizeof(sa));
	salen = sizeof(sa);
	getpeername(cfd, (struct sockaddr *)&sa, &salen);

	D_DEBUG("opmode = %d", opmode);

	for (;;)
	{
		retval = read(cfd, buf, bufsize);
		if (retval == 0) {
			D_DEBUG("client [%08x:%d] disconnected.\n",
					sa.sin_addr.s_addr, ntohs(sa.sin_port));
			break;
		}

		if (retval == -1) {
			if (errno == EINTR)
				continue;
			perror("read socket failed");
			break;
		}
		// printf("read ok\n");

		if (opmode == OPMODE_DISCARD)
			continue;
		else if (opmode == OPMODE_ECHO) {
			retval = write(cfd, buf, retval);
			if (retval == -1) {
				perror("write socket failed");
				break;
			}
			// printf("write ok\n");
		}
		else if (opmode == OPMODE_WRITE_STDOUT) {
			retval = write(STDOUT_FILENO, buf, retval);
			if (retval == -1) {
				if (errno == EINTR)
					continue;
				perror("write stdout failed");
				exit(1);
			}
		}
	}

	return 0;
}
开发者ID:cokecode,项目名称:common,代码行数:54,代码来源:tcp_server.c

示例3: driver_close_device

static void
driver_close_device( CoreGraphicsDevice *device,
                     void               *driver_data,
                     void               *device_data )
{
     ATI128DeviceData *adev = (ATI128DeviceData*) device_data;
     ATI128DriverData *adrv = (ATI128DriverData*) driver_data;
     volatile u8      *mmio = adrv->mmio_base;

     D_DEBUG( "DirectFB/ATI128: FIFO Performance Monitoring:\n" );
     D_DEBUG( "DirectFB/ATI128:  %9d ati128_waitfifo calls\n",
               adev->waitfifo_calls );
     D_DEBUG( "DirectFB/ATI128:  %9d register writes (ati128_waitfifo sum)\n",
               adev->waitfifo_sum );
     D_DEBUG( "DirectFB/ATI128:  %9d FIFO wait cycles (depends on CPU)\n",
               adev->fifo_waitcycles );
     D_DEBUG( "DirectFB/ATI128:  %9d IDLE wait cycles (depends on CPU)\n",
               adev->idle_waitcycles );
     D_DEBUG( "DirectFB/ATI128:  %9d FIFO space cache hits(depends on CPU)\n",
               adev->fifo_cache_hits );
     D_DEBUG( "DirectFB/ATI128: Conclusion:\n" );
     D_DEBUG( "DirectFB/ATI128:  Average register writes/ati128_waitfifo"
               "call:%.2f\n",
               adev->waitfifo_sum/(float)(adev->waitfifo_calls) );
     D_DEBUG( "DirectFB/ATI128:  Average wait cycles/ati128_waitfifo call:"
               " %.2f\n",
               adev->fifo_waitcycles/(float)(adev->waitfifo_calls) );
     D_DEBUG( "DirectFB/ATI128:  Average fifo space cache hits: %02d%%\n",
               (int)(100 * adev->fifo_cache_hits/
               (float)(adev->waitfifo_calls)) );

     /* clean up, make sure that aty128fb does not hang in kernel space
        afterwards  */
     ati128_waitfifo( adrv, adev, 3 );

     ati128_out32( mmio, DP_GUI_MASTER_CNTL,
                         GMC_SRC_PITCH_OFFSET_DEFAULT |
                         GMC_DST_PITCH_OFFSET_DEFAULT |
                         GMC_SRC_CLIP_DEFAULT         |
                         GMC_DST_CLIP_DEFAULT         |
                         GMC_BRUSH_SOLIDCOLOR         |
                         GMC_SRC_DSTCOLOR             |
                         GMC_BYTE_ORDER_MSB_TO_LSB    |
                         GMC_DP_CONVERSION_TEMP_6500  |
                         ROP3_PATCOPY                 |
                         GMC_DP_SRC_RECT              |
                         GMC_3D_FCN_EN_CLR            |
                         GMC_DST_CLR_CMP_FCN_CLEAR    |
                         GMC_AUX_CLIP_CLEAR           |
                         GMC_WRITE_MASK_SET);

     ati128_out32( mmio, SCALE_3D_CNTL, 0x00000000 );
     ati128_out32( mmio, TEX_CNTL, 0x00000000 );
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:54,代码来源:ati128.c

示例4: ds_cont_op_handler

/* Look up the pool handle and the matching container service. */
void
ds_cont_op_handler(crt_rpc_t *rpc)
{
	struct cont_op_in      *in = crt_req_get(rpc);
	struct cont_op_out     *out = crt_reply_get(rpc);
	struct ds_pool_hdl     *pool_hdl;
	crt_opcode_t		opc = opc_get(rpc->cr_opc);
	daos_prop_t	       *prop = NULL;
	struct cont_svc	       *svc;
	int			rc;

	pool_hdl = ds_pool_hdl_lookup(in->ci_pool_hdl);
	if (pool_hdl == NULL)
		D_GOTO(out, rc = -DER_NO_HDL);

	D_DEBUG(DF_DSMS, DF_CONT": processing rpc %p: hdl="DF_UUID" opc=%u\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->ci_uuid), rpc,
		DP_UUID(in->ci_hdl), opc);

	/*
	 * TODO: How to map to the correct container service among those
	 * running of this storage node? (Currently, there is only one, with ID
	 * 0, colocated with the pool service.)
	 */
	rc = cont_svc_lookup_leader(pool_hdl->sph_pool->sp_uuid, 0 /* id */,
				    &svc, &out->co_hint);
	if (rc != 0)
		D_GOTO(out_pool_hdl, rc);

	rc = cont_op_with_svc(pool_hdl, svc, rpc);

	ds_rsvc_set_hint(svc->cs_rsvc, &out->co_hint);
	cont_svc_put_leader(svc);
out_pool_hdl:
	D_DEBUG(DF_DSMS, DF_CONT": replying rpc %p: hdl="DF_UUID
		" opc=%u rc=%d\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->ci_uuid), rpc,
		DP_UUID(in->ci_hdl), opc, rc);
	ds_pool_hdl_put(pool_hdl);
out:
	/* cleanup the properties for cont_query */
	if (opc == CONT_QUERY) {
		struct cont_query_out  *cqo = crt_reply_get(rpc);

		prop = cqo->cqo_prop;
	}
	out->co_rc = rc;
	crt_reply_send(rpc);
	daos_prop_free(prop);

	return;
}
开发者ID:daos-stack,项目名称:daos,代码行数:53,代码来源:srv_container.c

示例5: cont_close_hdls

/* Close an array of handles, possibly belonging to different containers. */
static int
cont_close_hdls(struct cont_svc *svc, struct cont_tgt_close_rec *recs,
		int nrecs, crt_context_t ctx)
{
	int	i;
	int	rc;

	D_ASSERTF(nrecs > 0, "%d\n", nrecs);
	D_DEBUG(DF_DSMS, DF_CONT": closing %d recs: recs[0].hdl="DF_UUID
		" recs[0].hce="DF_U64"\n", DP_CONT(svc->cs_pool_uuid, NULL),
		nrecs, DP_UUID(recs[0].tcr_hdl), recs[0].tcr_hce);

	rc = cont_close_bcast(ctx, svc, recs, nrecs);
	if (rc != 0)
		D_GOTO(out, rc);

	/*
	 * Use one TX per handle to avoid calling ds_cont_epoch_fini_hdl() more
	 * than once in a TX, in which case we would be attempting to query
	 * uncommitted updates. This could be optimized by adding container
	 * UUIDs into recs[i] and sorting recs[] by container UUIDs. Then we
	 * could maintain a list of deleted LREs and a list of deleted LHEs for
	 * each container while looping, and use the lists to update the GHCE
	 * once for each container. This approach enables us to commit only
	 * once (or when a TX becomes too big).
	 */
	for (i = 0; i < nrecs; i++) {
		struct rdb_tx tx;

		rc = rdb_tx_begin(svc->cs_rsvc->s_db, svc->cs_rsvc->s_term,
				  &tx);
		if (rc != 0)
			break;
		rc = cont_close_one_hdl(&tx, svc, ctx, recs[i].tcr_hdl);
		if (rc != 0) {
			rdb_tx_end(&tx);
			break;
		}
		rc = rdb_tx_commit(&tx);
		rdb_tx_end(&tx);
		if (rc != 0)
			break;
	}

out:
	D_DEBUG(DF_DSMS, DF_CONT": leaving: %d\n",
		DP_CONT(svc->cs_pool_uuid, NULL), rc);
	return rc;
}
开发者ID:daos-stack,项目名称:daos,代码行数:50,代码来源:srv_container.c

示例6: cont_close

static int
cont_close(struct rdb_tx *tx, struct ds_pool_hdl *pool_hdl, struct cont *cont,
	   crt_rpc_t *rpc)
{
	struct cont_close_in	       *in = crt_req_get(rpc);
	daos_iov_t			key;
	daos_iov_t			value;
	struct container_hdl		chdl;
	struct cont_tgt_close_rec	rec;
	int				rc;

	D_DEBUG(DF_DSMS, DF_CONT": processing rpc %p: hdl="DF_UUID"\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->cci_op.ci_uuid), rpc,
		DP_UUID(in->cci_op.ci_hdl));

	/* See if this container handle is already closed. */
	daos_iov_set(&key, in->cci_op.ci_hdl, sizeof(uuid_t));
	daos_iov_set(&value, &chdl, sizeof(chdl));
	rc = rdb_tx_lookup(tx, &cont->c_svc->cs_hdls, &key, &value);
	if (rc != 0) {
		if (rc == -DER_NONEXIST) {
			D_DEBUG(DF_DSMS, DF_CONT": already closed: "DF_UUID"\n",
				DP_CONT(cont->c_svc->cs_pool->sp_uuid,
					cont->c_uuid),
				DP_UUID(in->cci_op.ci_hdl));
			rc = 0;
		}
		D_GOTO(out, rc);
	}

	uuid_copy(rec.tcr_hdl, in->cci_op.ci_hdl);
	rec.tcr_hce = chdl.ch_hce;

	D_DEBUG(DF_DSMS, DF_CONT": closing: hdl="DF_UUID" hce="DF_U64"\n",
		DP_CONT(cont->c_svc->cs_pool_uuid, in->cci_op.ci_uuid),
		DP_UUID(rec.tcr_hdl), rec.tcr_hce);

	rc = cont_close_bcast(rpc->cr_ctx, cont->c_svc, &rec, 1 /* nrecs */);
	if (rc != 0)
		D_GOTO(out, rc);

	rc = cont_close_one_hdl(tx, cont->c_svc, rpc->cr_ctx, rec.tcr_hdl);

out:
	D_DEBUG(DF_DSMS, DF_CONT": replying rpc %p: %d\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->cci_op.ci_uuid), rpc,
		rc);
	return rc;
}
开发者ID:daos-stack,项目名称:daos,代码行数:49,代码来源:srv_container.c

示例7: cont_query

static int
cont_query(struct rdb_tx *tx, struct ds_pool_hdl *pool_hdl, struct cont *cont,
	   struct container_hdl *hdl, crt_rpc_t *rpc)
{
	struct cont_query_in   *in  = crt_req_get(rpc);
	struct cont_query_out  *out = crt_reply_get(rpc);
	daos_prop_t	       *prop = NULL;
	int			rc = 0;

	D_DEBUG(DF_DSMS, DF_CONT": processing rpc %p: hdl="DF_UUID"\n",
		DP_CONT(pool_hdl->sph_pool->sp_uuid, in->cqi_op.ci_uuid), rpc,
		DP_UUID(in->cqi_op.ci_hdl));

	rc = cont_query_bcast(rpc->cr_ctx, cont, in->cqi_op.ci_pool_hdl,
			      in->cqi_op.ci_hdl, out);
	if (rc)
		return rc;

	/* the allocated prop will be freed after rpc replied in
	 * ds_cont_op_handler.
	 */
	rc = cont_prop_read(tx, cont, in->cqi_bits, &prop);
	out->cqo_prop = prop;

	return rc;
}
开发者ID:daos-stack,项目名称:daos,代码行数:26,代码来源:srv_container.c

示例8: uc_ovl_set_region

static DFBResult
uc_ovl_set_region( CoreLayer                  *layer,
                   void                       *driver_data,
                   void                       *layer_data,
                   void                       *region_data,
                   CoreLayerRegionConfig      *config,
                   CoreLayerRegionConfigFlags  updated,
                   CoreSurface                *surface,
                   CorePalette                *palette )
{
    UcDriverData*  ucdrv = (UcDriverData*) driver_data;
    UcOverlayData* ucovl = (UcOverlayData*) layer_data;

    /* get new destination rectangle */
    DFBRectangle win = config->dest;;

    // Bounds checking
    if ((win.x < -8192) || (win.x > 8192) ||
        (win.y < -8192) || (win.y > 8192) ||
        (win.w < 32) || (win.w > 4096) ||
        (win.h < 32) || (win.h > 4096))
    {
        D_DEBUG("Layer size or position is out of bounds.");
        return DFB_INVAREA;
    }

    ucovl->v1.isenabled = true;
    ucovl->v1.win = win;

    ucovl->deinterlace = config->options & DLOP_DEINTERLACING;
    ucovl->surface     = surface;

    return uc_ovl_update(ucdrv, ucovl, UC_OVL_CHANGE, surface);
}
开发者ID:spartan263,项目名称:vizio_oss,代码行数:34,代码来源:uc_overlay.c

示例9: ds_mgmt_fini

static int
ds_mgmt_fini()
{
	ds_mgmt_tgt_fini();
	D_DEBUG(DB_MGMT, "successfull fini call\n");
	return 0;
}
开发者ID:daos-stack,项目名称:daos,代码行数:7,代码来源:srv.c

示例10: crtc1GetScreenSize

static DFBResult
crtc1GetScreenSize( CoreScreen *screen,
                    void       *driver_data,
                    void       *screen_data,
                    int        *ret_width,
                    int        *ret_height )
{
     NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data;
     volatile u8      *mmio  = nvdrv->mmio_base;
     int               w, h;
     int               val;

     /* stolen from RivaTV */
     
	w   = nv_incrtc( mmio, CRTC_HORIZ_DISPLAY_END );
	w  |= (nv_incrtc( mmio, CRTC_HORIZ_EXTRA ) & 0x02) << 7;
	w   = (w + 1) << 3;
	
	h   = nv_incrtc( mmio, CRTC_VERT_DISPLAY_END );
	val = nv_incrtc( mmio, CRTC_OVERFLOW );
	h  |= (val & 0x02) << 7;
	h  |= (val & 0x40) << 3;
	h++;
	h  |= nv_incrtc( mmio, CRTC_EXTRA ) << 9;
	h  |= nv_incrtc( mmio, 0x41 ) << 9;
	h >>= (nv_incrtc( mmio, CRTC_MAX_SCAN_LINE ) & 0x80) >> 7;
	
     D_DEBUG( "DirectFB/NVidia/Crtc1: "
              "detected screen resolution %dx%d.\n", w, h );

     *ret_width  = w;
     *ret_height = h;
     
     return DFB_OK;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:35,代码来源:nvidia_primary.c

示例11: smd_nvme_md_stab_create

int
smd_nvme_md_stab_create(struct umem_attr *p_umem_attr,
			struct smd_nvme_stream_tab_df *table_df)
{
	int		rc = 0;
	daos_handle_t	btr_hdl;

	D_ASSERT(table_df->nst_btr.tr_class == 0);
	D_DEBUG(DB_DF, "Create Persistent NVMe MD Device Index, type=%d\n",
		DBTREE_CLASS_SMD_DTAB);

	rc = dbtree_create_inplace(DBTREE_CLASS_SMD_STAB, 0, SMD_STAB_ORDER,
				   p_umem_attr, &table_df->nst_btr, &btr_hdl);
	if (rc) {
		D_ERROR("Persistent NVMe pool dbtree create failed\n");
		D_GOTO(exit, rc);
	}

	rc = dbtree_close(btr_hdl);
	if (rc)
		D_ERROR("Error in closing btree handle\n");
exit:
	return rc;

}
开发者ID:daos-stack,项目名称:daos,代码行数:25,代码来源:smd_stream.c

示例12: process_killrank_request

static void
process_killrank_request(Drpc__Call *drpc_req, Mgmt__DaosResponse *daos_resp)
{
	Mgmt__DaosRank	*pb_rank = NULL;

	mgmt__daos_response__init(daos_resp);

	/* Unpack the daos request from the drpc call body */
	pb_rank = mgmt__daos_rank__unpack(
		NULL, drpc_req->body.len, drpc_req->body.data);

	if (pb_rank == NULL) {
		daos_resp->status = MGMT__DAOS_REQUEST_STATUS__ERR_UNKNOWN;
		D_ERROR("Failed to extract rank from request\n");

		return;
	}

	/* response status is populated with SUCCESS on init */
	D_DEBUG(DB_MGMT, "Received request to kill rank (%u) on pool (%s)\n",
		pb_rank->rank, pb_rank->pool_uuid);

	/* TODO: do something with request and populate daos response status */

	mgmt__daos_rank__free_unpacked(pb_rank, NULL);
}
开发者ID:daos-stack,项目名称:daos,代码行数:26,代码来源:srv.c

示例13: IDirectFBInputDevice_Dispatcher_Destruct

static void
IDirectFBInputDevice_Dispatcher_Destruct( IDirectFBInputDevice *thiz )
{
     D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz );

     DIRECT_DEALLOCATE_INTERFACE( thiz );
}
开发者ID:batman52,项目名称:dingux-code,代码行数:7,代码来源:idirectfbinputdevice_dispatcher.c

示例14: handle_response

static void
handle_response( VoodooManager         *manager,
                 VoodooResponseMessage *response )
{
     D_MAGIC_ASSERT( manager, VoodooManager );
     D_ASSERT( response != NULL );
     D_ASSERT( response->header.size >= sizeof(VoodooResponseMessage) );
     D_ASSERT( response->header.type == VMSG_RESPONSE );
     D_ASSERT( response->request < manager->msg_serial );

     D_DEBUG( "Voodoo/Dispatch: Handling RESPONSE message %llu (%s) with instance %u for request "
              "%llu (%d bytes).\n", (unsigned long long)response->header.serial, DirectResultString( response->result ),
              response->instance, (unsigned long long)response->request, response->header.size );

     pthread_mutex_lock( &manager->response.lock );

     D_ASSERT( manager->response.current == NULL );

     manager->response.current = response;

     pthread_cond_broadcast( &manager->response.wait );

     while (manager->response.current && !manager->quit)
          pthread_cond_wait( &manager->response.wait, &manager->response.lock );

     pthread_mutex_unlock( &manager->response.lock );
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:27,代码来源:manager.c

示例15: voodoo_manager_quit

DirectResult
voodoo_manager_quit( VoodooManager *manager )
{
     D_MAGIC_ASSERT( manager, VoodooManager );
     D_ASSUME( !manager->quit );

     if (manager->quit)
          return DR_OK;

     D_DEBUG( "Voodoo/Manager: Quitting manager at %p!\n", manager );

     /* Have all threads quit upon this. */
     manager->quit = true;

     /* Acquire locks and wake up waiters. */
     pthread_mutex_lock( &manager->input.lock );
     pthread_cond_broadcast( &manager->input.wait );
     pthread_mutex_unlock( &manager->input.lock );

     pthread_mutex_lock( &manager->response.lock );
     pthread_cond_broadcast( &manager->response.wait );
     pthread_mutex_unlock( &manager->response.lock );

     pthread_mutex_lock( &manager->output.lock );
     pthread_cond_broadcast( &manager->output.wait );
     pthread_mutex_unlock( &manager->output.lock );

     return DR_OK;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:29,代码来源:manager.c


注:本文中的D_DEBUG函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。