本文整理匯總了C++中DBG3函數的典型用法代碼示例。如果您正苦於以下問題:C++ DBG3函數的具體用法?C++ DBG3怎麽用?C++ DBG3使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DBG3函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: pthread_mutex_lock
/*
* Return an allocated lttng hashtable.
*/
LTTNG_HIDDEN
struct lttng_ht *lttng_ht_new(unsigned long size, int type)
{
struct lttng_ht *ht;
/* Test size */
if (!size)
size = DEFAULT_HT_SIZE;
pthread_mutex_lock(&seed_lock);
if (!seed_init) {
lttng_ht_seed = (unsigned long) time(NULL);
seed_init = true;
}
pthread_mutex_unlock(&seed_lock);
ht = zmalloc(sizeof(*ht));
if (ht == NULL) {
PERROR("zmalloc lttng_ht");
goto error;
}
ht->ht = cds_lfht_new(size, min_hash_alloc_size, max_hash_buckets_size,
CDS_LFHT_AUTO_RESIZE | CDS_LFHT_ACCOUNTING, NULL);
/*
* There is already an assert in the RCU hashtable code so if the ht is
* NULL here there is a *huge* problem.
*/
assert(ht->ht);
switch (type) {
case LTTNG_HT_TYPE_STRING:
ht->match_fct = match_str;
ht->hash_fct = hash_key_str;
break;
case LTTNG_HT_TYPE_ULONG:
ht->match_fct = match_ulong;
ht->hash_fct = hash_key_ulong;
break;
case LTTNG_HT_TYPE_U64:
ht->match_fct = match_u64;
ht->hash_fct = hash_key_u64;
break;
case LTTNG_HT_TYPE_TWO_U64:
ht->match_fct = match_two_u64;
ht->hash_fct = hash_key_two_u64;
break;
default:
ERR("Unknown lttng hashtable type %d", type);
lttng_ht_destroy(ht);
goto error;
}
DBG3("Created hashtable size %lu at %p of type %d", size, ht->ht, type);
return ht;
error:
return NULL;
}
示例2: channel_ust_enable
/*
* Enable UST channel for session and domain.
*/
int channel_ust_enable(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
int ret = LTTNG_OK;
assert(usess);
assert(uchan);
/* If already enabled, everything is OK */
if (uchan->enabled) {
DBG3("Channel %s already enabled. Skipping", uchan->name);
ret = LTTNG_ERR_UST_CHAN_EXIST;
goto end;
}
DBG2("Channel %s being enabled in UST domain", uchan->name);
/*
* Enable channel for UST global domain on all applications. Ignore return
* value here since whatever error we got, it means that the channel was
* not created on one or many registered applications and we can not report
* this to the user yet. However, at this stage, the channel was
* successfully created on the session daemon side so the enable-channel
* command is a success.
*/
(void) ust_app_enable_channel_glb(usess, uchan);
uchan->enabled = 1;
DBG2("Channel %s enabled successfully", uchan->name);
end:
return ret;
}
示例3: DBG3
GList* DataStorage::lookup_network(const gchar *a_object_path) {
GList *item = NULL;
DBG3();
if(a_object_path == NULL) {
ERR("no object_path.");
return NULL;
}
if(m_list_networks == NULL) {
DBG2("network not found, list is empty.");
return NULL;
}
item = g_list_find_custom(m_list_networks, a_object_path, compare_object_path);
if(item != NULL) {
DBG2("network found");
return item;
}
else {
DBG2("network not found.");
}
return NULL;
}
示例4: DBG3
void BuzzMDKHelper::MidiControlChange(const int ctrl, const int channel, const int value ) {
DBG3("(ctrl=%d,channel=%d,value=%d)\n",ctrl,channel,value);
/*
if( pInnerEx != NULL )
pInnerEx->MidiControlChange( ctrl, channel, value );
*/
}
示例5: ust_consumer_send_stream_to_ust
/*
* Send a given stream to UST tracer.
*
* On success return 0 else a negative value.
*/
int ust_consumer_send_stream_to_ust(struct ust_app *app,
struct ust_app_channel *channel, struct ust_app_stream *stream)
{
int ret;
assert(app);
assert(stream);
assert(channel);
DBG2("UST consumer send stream to app %d", app->sock);
/* Relay stream to application. */
pthread_mutex_lock(&app->sock_lock);
ret = ustctl_send_stream_to_ust(app->sock, channel->obj, stream->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("ustctl send stream handle %d to app pid: %d with ret %d",
stream->obj->handle, app->pid, ret);
} else {
DBG3("UST app send stream to ust failed. Application is dead.");
}
goto error;
}
channel->handle = channel->obj->handle;
error:
return ret;
}
示例6: run_as_extract_elf_symbol_offset
LTTNG_HIDDEN
int run_as_extract_elf_symbol_offset(int fd, const char* function,
uid_t uid, gid_t gid, uint64_t *offset)
{
struct run_as_data data;
struct run_as_ret ret;
memset(&data, 0, sizeof(data));
memset(&ret, 0, sizeof(ret));
DBG3("extract_elf_symbol_offset() on fd=%d and function=%s "
"with for uid %d and gid %d", fd, function, (int) uid, (int) gid);
data.fd = fd;
strncpy(data.u.extract_elf_symbol_offset.function, function, LTTNG_SYMBOL_NAME_LEN - 1);
data.u.extract_elf_symbol_offset.function[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
run_as(RUN_AS_EXTRACT_ELF_SYMBOL_OFFSET, &data, &ret, uid, gid);
errno = ret._errno;
if (ret._error) {
return -1;
}
*offset = ret.u.extract_elf_symbol_offset.offset;
return 0;
}
示例7: ust_consumer_ask_channel
/*
* Ask consumer to create a channel for a given session.
*
* Returns 0 on success else a negative value.
*/
int ust_consumer_ask_channel(struct ust_app_session *ua_sess,
struct ust_app_channel *ua_chan, struct consumer_output *consumer,
struct consumer_socket *socket, struct ust_registry_session *registry)
{
int ret;
assert(ua_sess);
assert(ua_chan);
assert(consumer);
assert(socket);
assert(registry);
if (!consumer->enabled) {
ret = -LTTNG_ERR_NO_CONSUMER;
DBG3("Consumer is disabled");
goto error;
}
pthread_mutex_lock(socket->lock);
ret = ask_channel_creation(ua_sess, ua_chan, consumer, socket, registry);
pthread_mutex_unlock(socket->lock);
if (ret < 0) {
goto error;
}
error:
return ret;
}
示例8: run_as_mkdirat
LTTNG_HIDDEN
int run_as_mkdirat(int dirfd, const char *path, mode_t mode,
uid_t uid, gid_t gid)
{
int ret;
struct run_as_data data;
struct run_as_ret run_as_ret;
memset(&data, 0, sizeof(data));
memset(&run_as_ret, 0, sizeof(run_as_ret));
DBG3("mkdirat() recursive fd = %d%s, path = %s, mode = %d, uid = %d, gid = %d",
dirfd, dirfd == AT_FDCWD ? " (AT_FDCWD)" : "",
path, (int) mode, (int) uid, (int) gid);
ret = lttng_strncpy(data.u.mkdirat.path, path,
sizeof(data.u.mkdirat.path));
if (ret) {
ERR("Failed to copy path argument of mkdirat command");
goto error;
}
data.u.mkdirat.path[PATH_MAX - 1] = '\0';
data.u.mkdirat.mode = mode;
data.fd = dirfd;
run_as(dirfd == AT_FDCWD ? RUN_AS_MKDIR : RUN_AS_MKDIRAT,
&data, &run_as_ret, uid, gid);
errno = run_as_ret._errno;
ret = run_as_ret._errno;
error:
return ret;
}
示例9: DBG3
gint ConnmanManager::add_service(ConnmanService *a_service) {
ConnmanService *service = NULL;
gint ret = 0;
DBG3();
if(a_service == NULL) {
ERR("no connman service '%p'", a_service);
return -1;
}
if(m_services == NULL) {
ERR("no services available.");
return -1;
}
service = lookup_service(a_service->get_object_path());
if(service != NULL) {
DBG("service '%s' already exists.", service->get_object_path());
return 0;
}
DBG("add new service '%s'.", a_service->get_object_path());
g_hash_table_insert(m_services, (gchar *)a_service->get_object_path(), a_service);
return 0;
}
示例10: recv_reply
/*
* Receive reply data on socket. This MUST be call after send_command or else
* could result in unexpected behavior(s).
*/
static int recv_reply(struct lttcomm_relayd_sock *rsock, void *data, size_t size)
{
int ret;
if (rsock->sock.fd < 0) {
return -ECONNRESET;
}
DBG3("Relayd waiting for reply of size %zu", size);
ret = rsock->sock.ops->recvmsg(&rsock->sock, data, size, 0);
if (ret <= 0 || ret != size) {
if (ret == 0) {
/* Orderly shutdown. */
DBG("Socket %d has performed an orderly shutdown", rsock->sock.fd);
} else {
DBG("Receiving reply failed on sock %d for size %zu with ret %d",
rsock->sock.fd, size, ret);
}
/* Always return -1 here and the caller can use errno. */
ret = -1;
goto error;
}
error:
return ret;
}
示例11: relayd_send_data_hdr
/*
* Send data header structure to the relayd.
*/
int relayd_send_data_hdr(struct lttcomm_relayd_sock *rsock,
struct lttcomm_relayd_data_hdr *hdr, size_t size)
{
int ret;
/* Code flow error. Safety net. */
assert(rsock);
assert(hdr);
if (rsock->sock.fd < 0) {
return -ECONNRESET;
}
DBG3("Relayd sending data header of size %zu", size);
/* Again, safety net */
if (size == 0) {
size = sizeof(struct lttcomm_relayd_data_hdr);
}
/* Only send data header. */
ret = rsock->sock.ops->sendmsg(&rsock->sock, hdr, size, 0);
if (ret < 0) {
ret = -errno;
goto error;
}
/*
* The data MUST be sent right after that command for the receive on the
* other end to match the size in the header.
*/
error:
return ret;
}
示例12: relayd_close
/*
* Close relayd socket with an allocated lttcomm_relayd_sock.
*
* If no socket operations are found, simply return 0 meaning that everything
* is fine. Without operations, the socket can not possibly be opened or used.
* This is possible if the socket was allocated but not created. However, the
* caller could simply use it to store a valid file descriptor for instance
* passed over a Unix socket and call this to cleanup but still without a valid
* ops pointer.
*
* Return the close returned value. On error, a negative value is usually
* returned back from close(2).
*/
int relayd_close(struct lttcomm_relayd_sock *rsock)
{
int ret;
/* Code flow error. Safety net. */
assert(rsock);
/* An invalid fd is fine, return success. */
if (rsock->sock.fd < 0) {
ret = 0;
goto end;
}
DBG3("Relayd closing socket %d", rsock->sock.fd);
if (rsock->sock.ops) {
ret = rsock->sock.ops->close(&rsock->sock);
} else {
/* Default call if no specific ops found. */
ret = close(rsock->sock.fd);
if (ret < 0) {
PERROR("relayd_close default close");
}
}
rsock->sock.fd = -1;
end:
return ret;
}
示例13: ust_consumer_send_channel_to_ust
/*
* Send channel previously received from the consumer to the UST tracer.
*
* On success return 0 else a negative value.
*/
int ust_consumer_send_channel_to_ust(struct ust_app *app,
struct ust_app_session *ua_sess, struct ust_app_channel *channel)
{
int ret;
assert(app);
assert(ua_sess);
assert(channel);
assert(channel->obj);
DBG2("UST app send channel to sock %d pid %d (name: %s, key: %" PRIu64 ")",
app->sock, app->pid, channel->name, channel->tracing_channel_id);
/* Send stream to application. */
pthread_mutex_lock(&app->sock_lock);
ret = ustctl_send_channel_to_ust(app->sock, ua_sess->handle, channel->obj);
pthread_mutex_unlock(&app->sock_lock);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("Error ustctl send channel %s to app pid: %d with ret %d",
channel->name, app->pid, ret);
} else {
DBG3("UST app send channel to ust failed. Application is dead.");
}
goto error;
}
error:
return ret;
}
示例14: relayd_connect
/*
* Connect to relay daemon with an allocated lttcomm_sock.
*/
int relayd_connect(struct lttcomm_sock *sock)
{
/* Code flow error. Safety net. */
assert(sock);
DBG3("Relayd connect ...");
return sock->ops->connect(sock);
}
示例15: set_Arm
void set_Arm (unsigned char mode)
{
#ifdef CMM_ARM_EXPERIMENT
unsigned long cur_pos;
unsigned char old_mode;
unsigned char pct_deployed;
get_ArmPosition(&cur_pos, &old_mode);
if (mode == old_mode) return;
if (old_mode != ARM_STOP)
{
if (cur_pos != arm_pos)
{
pct_deployed = cur_pos / ARM_STROKE_PCT;
#ifdef ARM_POS_DEBUG
DBG("Arm moved ");
if (cur_pos > arm_pos)
DBG2("+%lu", cur_pos - arm_pos);
else
DBG2("-%lu", arm_pos - cur_pos);
DBG3(" to %lu (%lu)\n", cur_pos, pct_deployed);
#endif
arm_pos = cur_pos;
}
}
else
{
pct_deployed = cur_pos / ARM_STROKE_PCT;
}
if (mode != ARM_STOP) gettimestamp(&arm_start);
#endif
switch (mode) {
default:
case ARM_STOP:
ARM(LAT) &= ~(ARM_UPDOWN_MASK | ARM_ONOFF_MASK);
break;
case ARM_UP:
ARM(LAT) &= ~ARM_UPDOWN_MASK;
ARM(LAT) |= ARM_ONOFF_MASK;
break;
case ARM_DOWN:
ARM(LAT) |= ARM_UPDOWN_MASK;
ARM(LAT) |= ARM_ONOFF_MASK;
break;
}
#ifdef CMM_ARM_EXPERIMENT
// % deployed in lower bits, mode in upper bits
eventlog_track(EVENTLOG_ARM, (((uint16_t)pct_deployed) << 8) | mode);
#else
eventlog_track(EVENTLOG_ARM, mode);
#endif
}