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


C++ TRACE_MSG函数代码示例

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


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

示例1: xpcf_list_find

LINK_DATA *csfnet_server_get_link(CSFNET_SERVER * server, UINT16 bus_type,
				  UINT16 link_id)
{
	LINK_DATA *link;
	LINK_KEY key;

	key.bus_type = bus_type;
	key.link_id = link_id;
	link =
	    (LINK_DATA *) xpcf_list_find(&server->links, link_find_handler,
					 &key);
	if (link == NULL) {
		link = (LINK_DATA *) xpcf_zalloc(sizeof(LINK_DATA));
		if (link) {
			link->bus_type = bus_type;
			link->link_id = link_id;
			xpcf_list_init(&link->clients);
			xpcf_list_add(&server->links, &link->list);
			TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT,
				  "Link 0x%p created (bus_type=0x%X, link_id=0x%X)\n",
				  link, bus_type, link_id);
		}
	}
	return link;
}
开发者ID:hiro-sakamoto,项目名称:csf,代码行数:25,代码来源:link.c

示例2: zb_aps_in_request_key

void zb_aps_in_request_key(zb_uint8_t param)
{
  /* get source address from the nwk header and convert it to long address */  
  zb_apsme_request_nwk_key_pkt_t *pkt = (zb_apsme_request_nwk_key_pkt_t *)ZB_BUF_BEGIN(ZB_BUF_FROM_REF(param));  
  zb_apsme_request_key_ind_t *ind = ZB_GET_BUF_PARAM(ZB_BUF_FROM_REF(param), zb_apsme_request_key_ind_t);
  TRACE_MSG(TRACE_SECUR2, ">>zb_aps_in_request_key", (FMT__0));
  {
    zb_uint16_t src_short_addr = ZB_GET_BUF_PARAM(ZB_BUF_FROM_REF(param), zb_apsde_data_indication_t)->src_addr;
    zb_address_ieee_by_short(src_short_addr, ind->src_address);
  }
  ind->key_type = pkt->key_type;
  /* TODO: fill partner_address for application key */
  ZB_SCHEDULE_CALLBACK(zb_apsme_request_key_indication, param);

  TRACE_MSG(TRACE_SECUR2, "<<zb_aps_in_request_key", (FMT__0));
}
开发者ID:Comfee,项目名称:zboss,代码行数:16,代码来源:apsme_secur.c

示例3: smbsim_serial_open

static int smbsim_serial_open(struct tty_struct *tty, struct file *filp)
{
	SMBSIM_SERIAL_DEV *dev = smbsim_serial_devs + tty->index;

	TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT, "0x%p\n", dev);
	return tty_port_open(&dev->tty_port, tty, filp);
}
开发者ID:hiro-sakamoto,项目名称:csf,代码行数:7,代码来源:main.c

示例4: nwk_route_disc_failed

void nwk_route_disc_failed(zb_uint8_t param) 
{
  zb_nlme_status_indication_t *status =  ZB_GET_BUF_PARAM(ZB_BUF_FROM_REF(param), zb_nlme_status_indication_t);

  TRACE_MSG(TRACE_NWK1, ">> nwk_route_disc_failed", (FMT__0));

  status->status = ZB_NWK_COMMAND_STATUS_NO_ROUTE_AVAILABLE;
  status->network_addr = ZG->nwk.handle.status_ind_addr;

  /* notify */
  ZB_SCHEDULE_CALLBACK(zb_nlme_status_indication, param);
  ZB_SCHEDULE_ALARM_CANCEL(zb_nwk_mesh_expiry_route_disc, 0);
  ZB_SCHEDULE_ALARM(zb_nwk_mesh_expiry_route_disc, 0, ZB_NWK_EXPIRY_ROUTE_DISCOVERY);

  TRACE_MSG(TRACE_NWK1, ">> nwk_route_disc_failed", (FMT__0));
}
开发者ID:alele89,项目名称:18748-WSN,代码行数:16,代码来源:nwk_cr_mesh_routing.c

示例5: DeviceOpen

NTSTATUS DeviceOpen(__in BASE_DEVICE * Device, __out BASE_FILE ** ppFile)
{
	BASE_FILE *File;
	BASE_FILE_PARAMS Params;
	NTSTATUS Status;

	PAGED_CODE();

	RtlZeroMemory(&Params, sizeof(Params));
	Params.PrivateAreaSize = 0;
	Params.Close = FileClose;
	Params.Cleanup = FileCleanup;
	Params.Read = FileRead;
	Params.Write = FileWrite;
	Params.Ioctl = FileIoctl;

	Status = BaseFileCreate(Device, &Params, &File);
	if (!NT_SUCCESS(Status)) {
		TRACE_ERR("BaseFileCreate", Status);
	} else {
		TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT,
			  "Device 0x%p opened (file 0x%p)\n", Device, File);
		*ppFile = File;
	}
	return Status;
}
开发者ID:hiro-sakamoto,项目名称:miscutil,代码行数:26,代码来源:common.c

示例6: render_destroy

void render_destroy(void)
{
	IF_FAILED(init);
	
	TRACE_MSG("release render resources\n");
	
	shader_program_file_destroy(&pfile);
	
	glDeleteBuffers(2, vbo);
	glDeleteVertexArrays(1, &vao);
	
	parser_clean(&parser);
	
	if(str_function) {
		free(str_function);
		str_function = NULL;
	}
	
	if(volume) {
		free(volume);
		volume = NULL;
	}
	
	init = 0;

	log_close();
}
开发者ID:RealSfera,项目名称:VRender,代码行数:27,代码来源:render.c

示例7: shader_program_file_create

int shader_program_file_create(shader_program_file_t *pfile, const char *filename)
{
	char *buffer = NULL;
	long file_size = 0L;
	
	IF_FAILED0(pfile && filename);
	
	TRACE_MSG("create shader program file; filename = %s \n", filename);
	
	file_size = utils_file_get_size(filename);
	// file_size + 1 - чтобы хватило места для \0
	buffer = (char*) malloc(sizeof(char) * (file_size+1));
	
	if(!utils_read_file(filename, buffer)) {
		ERROR_MSG("cannot open shader program file\n");
		return 0;
	}
	
	if(!parse_and_load_shader(buffer, pfile))
		return 0;
	
	free(buffer);
	
	return 1;
}
开发者ID:RealSfera,项目名称:VRender,代码行数:25,代码来源:shader_program_file.c

示例8: scan_files

static FRESULT scan_files(char* path)
{
	FRESULT res;
	FILINFO fno;
	DIR dir;
	int i;
	char *fn;

	res = f_opendir(&dir, path);
	if (res == FR_OK)
	{
		i = strlen(path);
		for (;;)
		{
			res = f_readdir(&dir, &fno);
			if (res != FR_OK || fno.fname[0] == 0) break;
			fn = fno.fname;
			if (*fn == '.') continue;
			if (fno.fattrib & AM_DIR)
			{
				TRACE_MSG(&path[i], "/%s", fn);
				res = scan_files(path);
				if (res != FR_OK) break;
				path[i] = 0;
			}
			else
			{
				DEBUG_MSG("%s/%s", path, fn);
			}
		}
	}

	return res;
}
开发者ID:Meteroi,项目名称:mboot,代码行数:34,代码来源:mboot.c

示例9: ZB_ASSERT

static zb_buf_t *zb_get_buf(zb_uint8_t is_in)
{
  zb_buf_t *buf = NULL;

  /* check that zb_init_buffers() was called */
  ZB_ASSERT(ZG->bpool.head || ZG->bpool.bufs_allocated[0] || ZG->bpool.bufs_allocated[1]);

  /*
    Logically pool divided into 2 parts: input or output.
    Do not allow one part to eat entire another part to exclude deadlock.
   */
  if (ZG->bpool.bufs_allocated[is_in] < ZB_BUFS_LIMIT)
  {
    buf = ZG->bpool.head;
    if (buf)
    {
      VERIFY_BUFS();
      ZG->bpool.head = buf->u.next;
      VERIFY_BUFS();
      ZB_BZERO(&buf->u, sizeof(buf->u));
      ZG->bpool.bufs_allocated[is_in]++;
      ZB_ASSERT(ZG->bpool.bufs_allocated[is_in] <= ZB_BUFS_LIMIT);
      buf->u.hdr.is_in_buf = is_in;
    }
  }
#ifdef ZB_DEBUG_BUFFERS
  TRACE_MSG( TRACE_MAC1, "zb_get_buf %hd: buffer %p, ref %hd, head %p, allocated %hd / %hd",
             (FMT__H_P_H_P_H, is_in, buf, ZB_REF_FROM_BUF(buf), ZG->bpool.head, ZG->bpool.bufs_allocated[0], ZG->bpool.bufs_allocated[1]));
#endif

  return buf;
}
开发者ID:Comfee,项目名称:zboss,代码行数:32,代码来源:zb_bufpool.c

示例10: send_data

static void send_data()
{
  zb_buf_t *buf = NULL;
  zb_apsde_data_req_t req;
  zb_uint8_t *ptr = NULL;
  zb_short_t i;

  buf = zb_get_out_buf();
  req.dst_addr.addr_short = 0; /* send to ZC */
  req.addr_mode = ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
  req.tx_options = ZB_APSDE_TX_OPT_ACK_TX;
  req.radius = 1;
  req.profileid = 2;
  req.src_endpoint = 10;
  req.dst_endpoint = 10;

  buf->u.hdr.handle = 0x11;
  ZB_BUF_INITIAL_ALLOC(buf, 80, ptr);

  for (i = 0 ; i < ZB_TEST_DATA_SIZE ; ++i)
  {
    ptr[i] = i % 32 + '0';
  }
  ZB_MEMCPY(
    ZB_GET_BUF_TAIL(buf, sizeof(req)),
    &req, sizeof(req));

  TRACE_MSG(TRACE_APS3, "Sending apsde_data.request", (FMT__0));

  ZB_SCHEDULE_CALLBACK(zb_apsde_data_request, ZB_REF_FROM_BUF(buf));
}
开发者ID:Comfee,项目名称:zboss,代码行数:31,代码来源:zdo_app.c

示例11: link_add_client

void link_add_client(LINK_DATA * link, CLIENT_DATA * client)
{
	TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT,
		  "Add client 0x%p to link 0x%p\n", client, link);
	client->link = link;
	xpcf_list_add(&link->clients, &client->list);
}
开发者ID:hiro-sakamoto,项目名称:csf,代码行数:7,代码来源:link.c

示例12: smbsim_serial_close

static void smbsim_serial_close(struct tty_struct *tty, struct file *filp)
{
	SMBSIM_SERIAL_DEV *dev = smbsim_serial_devs + tty->index;

	TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT, "0x%p\n", dev);
	tty_port_close(&dev->tty_port, tty, filp);
}
开发者ID:hiro-sakamoto,项目名称:csf,代码行数:7,代码来源:main.c

示例13: TRACE_MSG

bool win_socket::write(void const* buf, size_t size, time_t timeout)
{ 
    time_t start = 0;
    if (state != ss_open) { 
        errcode = not_opened;
        TRACE_MSG(("Socket is not openned\n"));
        return false;
    }
    if (timeout != WAIT_FOREVER) { 
        start = time(NULL); 
    }
    
    do { 
        int rc;
        if (timeout != WAIT_FOREVER) { 
            fd_set events;
            struct timeval tm;
            FD_ZERO(&events);
            FD_SET(s, &events);
            tm.tv_sec = (long)timeout;
            tm.tv_usec = 0;
            rc = select((int)s+1, NULL, &events, NULL, &tm);
            if (rc <= 0) { 
                errcode = WSAGetLastError();
                TRACE_MSG(("Socket select is failed: %d\n", errcode));
                return false;
            }
            time_t now = time(NULL);
            timeout = start + timeout >= now ? timeout + start - now : 0;  
        }
        rc = send(s, (char*)buf, (int)size, 0);
        if (rc < 0) { 
            errcode = WSAGetLastError();
            TRACE_MSG(("Socket write is failed: %d\n", errcode));
            return false;
        } else if (rc == 0) {
            errcode = broken_pipe;
            TRACE_MSG(("Socket is disconnected\n"));
            return false; 
        } else { 
            buf = (char*)buf + rc; 
            size -= rc; 
        }
    } while (size != 0); 

    return true;
}
开发者ID:nakijun,项目名称:FusionDB,代码行数:47,代码来源:w32sock.cpp

示例14: zb_free_buf

void zb_free_buf(zb_buf_t *buf)
{
  /* do trace this function, because it can cause lack of out buffers */
  zb_buf_q_ent_t *ent = NULL;

  /* check that zb_init_buffers() was called */
  ZB_ASSERT(ZG->bpool.head || ZG->bpool.bufs_allocated[0] || ZG->bpool.bufs_allocated[1]);

  ZB_ASSERT(ZG->bpool.bufs_allocated[buf->u.hdr.is_in_buf] > 0);
  ZG->bpool.bufs_allocated[buf->u.hdr.is_in_buf]--;

#ifdef ZB_DEBUG_BUFFERS
  TRACE_MSG(TRACE_NWK3, "zb_free_buf %p, ref %hd, in buf %hi allocated in %hd out %hd",
            (FMT__P_H_H_H_H, buf, ZB_REF_FROM_BUF(buf), buf->u.hdr, buf->u.hdr.is_in_buf,
             ZG->bpool.bufs_allocated[1], ZG->bpool.bufs_allocated[0]));
#endif

  VERIFY_BUF(buf);
  buf->u.next = ZG->bpool.head;
  ZG->bpool.head = buf;
  VERIFY_BUFS();

  if (buf->u.hdr.is_in_buf)
  {
    /* if we need a buffer for rx packet, we should not pass it to some */
  /* other callback */
  if (!MAC_CTX().rx_need_buf)
      ZB_SL_LIST_CUT_HEAD(ZG->sched.inbuf_queue, next, ent);
  }
  else
  {
    ZB_SL_LIST_CUT_HEAD(ZG->sched.outbuf_queue, next, ent);
  }
  if (ent)
  {
    ZB_SCHEDULE_CALLBACK(ent->func, ZB_REF_FROM_BUF(zb_get_buf(buf->u.hdr.is_in_buf)));
    ZB_STK_PUSH(ZG->sched.buf_freelist, next, ent);
  }

#ifdef ZB_DEBUG_BUFFERS
  TRACE_MSG( TRACE_MAC1, "free_buf: %hd/%hd buf %p, next %p, head %p",
             (FMT__H_H_P_P_P,
              ZG->bpool.bufs_allocated[1], ZG->bpool.bufs_allocated[0],
              buf, buf->u.next, ZG->bpool.head));
#endif

}
开发者ID:Comfee,项目名称:zboss,代码行数:47,代码来源:zb_bufpool.c

示例15: smbsim_serial_write

static int smbsim_serial_write(struct tty_struct *tty, const unsigned char *buf,
			       int count)
{
	SMBSIM_SERIAL_DEV *dev = smbsim_serial_devs + tty->index;
	int ret;

	TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT, "0x%p - count=%d\n",
		  dev, count);
	DUMP_MEM(buf, count);

	if (count == 0) {
		TRACE_MSG(TRACE_LEVEL_ERROR, TRACE_FLAG_DEFAULT,
			  "Invalid count=%u\n", count);
		return 0;
	}

	if (dev->write_size == 0) {
		if (buf[0] > WRITE_BUF_SZ) {
			TRACE_MSG(TRACE_LEVEL_ERROR, TRACE_FLAG_DEFAULT,
				  "Invalid size=%u\n", buf[0]);
			return -EINVAL;
		}
		dev->write_size = buf[0];
		dev->cur_size = count - 1;
		if (dev->cur_size)
			memcpy(dev->write_data, buf + 1, dev->cur_size);
	} else {
		memcpy(dev->write_data + dev->cur_size, buf, count);
		dev->cur_size += count;
	}

	if (dev->cur_size < dev->write_size) {
		TRACE_MSG(TRACE_LEVEL_WARN, TRACE_FLAG_DEFAULT,
			  "Need more data (cur=%u, total=%u)\n", dev->cur_size,
			  dev->write_size);
		return count;
	}

	TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT, "Write %u bytes\n",
		  dev->write_size);
	ret = smbsim_serial_port_write(&dev->port, dev->write_data,
				       dev->write_size);
	dev->write_size = 0;
	if (ret)
		return ret;
	return count;
}
开发者ID:hiro-sakamoto,项目名称:csf,代码行数:47,代码来源:main.c


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