本文整理汇总了C++中print_trace函数的典型用法代码示例。如果您正苦于以下问题:C++ print_trace函数的具体用法?C++ print_trace怎么用?C++ print_trace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_trace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_map
void print_map(t_info *s)
{
t_point p1;
t_point p2;
while (s->y < s->x_lines)
{
while (s->x < s->y_lines)
{
p1 = calcul(s->x, s->y, s->tab[s->y][s->x], s);
s->x++;
init_color(s, s->tab[s->y][s->x]);
if (s->x < s->y_lines)
{
p2 = calcul(s->x, s->y, s->tab[s->y][s->x], s);
print_trace(p1, p2, s);
}
if (s->y < s->x_lines - 1)
{
p2 = calcul(s->x - 1, s->y + 1, s->tab[s->y + 1][s->x - 1], s);
print_trace(p1, p2, s);
}
}
s->x = 0;
s->y++;
}
}
示例2: rte_keepalive_dispatch_pings
void
rte_keepalive_dispatch_pings(__rte_unused void *ptr_timer,
void *ptr_data)
{
struct rte_keepalive *keepcfg = ptr_data;
int idx_core;
for (idx_core = 0; idx_core < RTE_KEEPALIVE_MAXCORES; idx_core++) {
if (keepcfg->active_cores[idx_core] == 0)
continue;
switch (keepcfg->state_flags[idx_core]) {
case ALIVE: /* Alive */
keepcfg->state_flags[idx_core] = MISSING;
keepcfg->last_alive[idx_core] = rte_rdtsc();
break;
case MISSING: /* MIA */
print_trace("Core MIA. ", keepcfg, idx_core);
keepcfg->state_flags[idx_core] = DEAD;
break;
case DEAD: /* Dead */
keepcfg->state_flags[idx_core] = GONE;
print_trace("Core died. ", keepcfg, idx_core);
if (keepcfg->callback)
keepcfg->callback(
keepcfg->callback_data,
idx_core
);
break;
case GONE: /* Buried */
break;
}
}
}
示例3: do_minimize
static pset_family
do_minimize(pset_family F, pset_family D, pset_family R, int exact_cover, int weighted)
{
pset_family newF, E, Rt, Rp;
pset p, last;
int heur, level, *weights;
sm_matrix *table;
sm_row *cover;
sm_element *pe;
int debug_save = debug;
if (debug & 0x0400) {
debug |= (0x0020 | 0x0800);
}
if (debug & 0x0800) {
setlinebuf((&_iob[1]));
}
level = (debug & 0x0800) ? 4 : 0;
heur = ! exact_cover;
{long t=util_cpu_time();F = primes_consensus(cube2list(F, D));if(trace)print_trace( F, "PRIMES ",util_cpu_time()-t);};
{long t=util_cpu_time();irred_split_cover(F, D, &E, &Rt, &Rp);if(trace)print_trace( E, "ESSENTIALS ",util_cpu_time()-t);};
{long t=util_cpu_time();table = irred_derive_table(D, E, Rp);if(trace)print_trace( Rp, "PI-TABLE ",util_cpu_time()-t);};
if (weighted) {
weights = ((int *) malloc(sizeof(int) * ( F->count)));
for( p=Rp->data, last= p+Rp->count*Rp->wsize; p< last; p+=Rp->wsize) {
weights[(p[0] >> 16)] = cube.size - set_ord(p);
}
} else {
示例4: hci_LE_read_local_supported_features
// RFU (Reserved for Future Use) : the only information available yet is the LE_Encryption...
int8_t hci_LE_read_local_supported_features(hci_socket_t *hci_socket, hci_controller_t *hci_controller,
uint8_t *features) { //p1056
char new_socket = 0;
CHECK_HCI_CONTROLLER_PTR(hci_controller, "hci_LE_read_local_supported_features");
CHECK_HCI_CONTROLLER_INTERRUPTED(hci_controller, hci_socket);
CHECK_HCI_CONTROLLER_OPEN(hci_controller, "hci_LE_read_local_supported_features");
if (!features) {
print_trace(TRACE_ERROR, "hci_LE_read_local_supported_features : invalid reference.\n");
goto fail;
}
struct hci_request rq;
memset(&rq, 0, sizeof(rq));
le_read_local_supported_features_rp rp;
memset(&rp, 0, sizeof(rp));
rq.ogf = OGF_LE_CTL;
rq.ocf = OCF_LE_READ_LOCAL_SUPPORTED_FEATURES;
rq.rparam = &rp;
rq.rlen = LE_READ_LOCAL_SUPPORTED_FEATURES_RP_SIZE;
char socket_err = 0;
check_hci_socket_ptr(&hci_socket, hci_controller, &new_socket, &socket_err);
if (socket_err) {
goto fail;
}
hci_change_state(hci_controller, HCI_STATE_READING);
if (hci_send_req(hci_socket->sock, &rq, HCI_CONTROLLER_DEFAULT_TIMEOUT) < 0) {
perror("hci_LE_read_local_supported_features");
goto fail;
}
hci_change_state(hci_controller, HCI_STATE_OPEN);
if (rp.status) {
print_trace(TRACE_ERROR, "hci_LE_read_supported_features : 0x%X\n", rp.status);
goto fail;
}
memcpy(features, rp.features, 8);
if (new_socket) {
close_hci_socket(hci_socket);
free(hci_socket);
}
return 0;
fail:
hci_change_state(hci_controller, HCI_STATE_OPEN);
if (new_socket) {
hci_close_socket_controller(hci_controller, hci_socket);
}
return -1;
}
示例5: writev
ssize_t
writev(int fd, const struct iovec *vector, int count)
{
ssize_t retval;
#ifdef X_BUF
print_trace ("%*swritev(%d, {", indent, "", fd);
for (int i=0; i<count; i++) {
print_msg ("{\"%s\", %d}%s",
vector[i].iov_base,
vector[i].iov_len,
i==count-1 ? "" : ", ");
}
print_msg ("}, %d)=...\n", count);
#else
print_trace ("%*swritev(%d, %p, %d)=...\n", indent, "",
fd, vector, count);
#endif
indent+=2;
/* call the real writev function */
retval = real_writev (fd, vector, count);
indent-=2;
print_trace ("%*swritev(%d, %p, %d)=%d\n", indent, "",
fd, vector, count, retval);
return retval;
}
示例6: l2cap_client_send
int8_t l2cap_client_send(l2cap_client_t *client, int16_t timeout, uint8_t req_type) {
if (!client) {
print_trace(TRACE_ERROR, "l2cap_client_send : invalid client.\n");
return -1;
}
if (client->connected) {
memset(client->buffer, 0, strlen(client->buffer));
client->send_request(*client, req_type);
int8_t n = 0;
int8_t bytes_read;
struct pollfd p;
p.fd = client->l2cap_socket.sock;
p.events = POLLIN;
while ((n = poll(&p, 1, timeout)) < 0) {
if (errno == EAGAIN || errno == EINTR) {
continue;
}
if (errno == ENOTCONN) {
client->connected = 0;
l2cap_client_close(client);
}
perror("l2cap_client_send : error while polling socket");
return -1;
}
if (!n) {
errno = ETIMEDOUT;
perror("l2cap_client_send : error while polling socket");
return -1;
}
while((bytes_read = read(client->l2cap_socket.sock,
client->buffer,
client->buffer_length)) < 0) {
if (errno == EAGAIN || errno == EINTR)
continue;
if (errno == ENOTCONN) {
client->connected = 0;
l2cap_client_close(client);
}
perror("l2cap_client_send : error while reading socket.\n");
return -1;
}
if (bytes_read == 0) { // 0 Bytes read means that the connection has been lost.
print_trace(TRACE_WARNING, "l2cap_client: connection reset by peer.\n");
client->connected = 0;
return -1;
}
client->treat_buffer(*client);
} else {
print_trace(TRACE_ERROR, "l2cap_client_send : invalid connexion.\n");
return -1;
}
return 0;
}
示例7: exit
void
exit(int status) throw()
{
print_trace ("%*sexit(%d)...\n", indent, "",
status);
indent+=2;
/* call the real exit function */
real_exit (status);
indent-=2;
print_trace ("%*sexit(%d)\n", indent, "",
status);
}
示例8: __cyg_profile_func_enter
/* The functions below are invoked automatically by code generated
* by the compiler. These are the entry points of the library. */
void __cyg_profile_func_enter(void *self, void *callsite)
{
if (!Tracing)
return;
if (print_trace(self, "ENTER"))
Callstack_depth++;
}
示例9: mbox_recv
/* Fetch a message from queue 'q' and store it in 'm' */
int mbox_recv(int q, msg_t * m)
{
lock_acquire(&Q[q].l);
print_trace("Recv", q, -1);
/* If no messages available, wait until there is one */
while (Q[q].count == 0) {
condition_wait(&Q[q].l, &Q[q].moreData);
}
/* copy header from mbox.buffer to m */
buffer_to_msg(Q[q].buffer, Q[q].tail, (char *) &m->size,
MSG_T_HEADER_SIZE);
/* Move tail to the body of message */
Q[q].tail = (Q[q].tail + MSG_T_HEADER_SIZE) % BUFFER_SIZE;
/* Copy body of message from mbox.buffer to m->body */
buffer_to_msg(Q[q].buffer, Q[q].tail, (char *) &m->body[0], m->size);
/* Move tail to the next message */
Q[q].tail =
(Q[q].tail + MSG_SIZE(m) - MSG_T_HEADER_SIZE) % BUFFER_SIZE;
/* Freeing space can satisy more than one writter */
condition_broadcast(&Q[q].moreSpace);
Q[q].count--;
lock_release(&Q[q].l);
return 1;
}
示例10: assert_locked_or_safepoint
void CodeCache::drop_scavenge_root_nmethod(nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
if (UseG1GC) {
return;
}
print_trace("drop_scavenge_root", nm);
nmethod* last = NULL;
nmethod* cur = scavenge_root_nmethods();
while (cur != NULL) {
nmethod* next = cur->scavenge_root_link();
if (cur == nm) {
if (last != NULL)
last->set_scavenge_root_link(next);
else set_scavenge_root_nmethods(next);
nm->set_scavenge_root_link(NULL);
nm->clear_on_scavenge_root_list();
return;
}
last = cur;
cur = next;
}
assert(false, "should have been on list");
}
示例11: init
static int init(void)
{
int ret;
print_trace("in\n");
print_info("kfabric/ibv provider initializing: version %d.%d.\n",
FI_MAJOR(ibvp.version), FI_MINOR(ibvp.version));
ret = kfi_register_provider(ibvp.version, &ibvp);
if (ret) {
print_err("register returned %d for KFI %s provider\n",
ret, ibvp.name);
return ret;
}
// ret = init_driver();
if (ret) {
print_err("init_driver returned %d for KFI %s provider\n",
ret, ibvp.name);
kfi_deregister_provider(&ibvp);
return ret;
}
initialized++;
print_dbg("KFI provider '%s' registered.\n", ibvp.name);
print_info("kfabric/ibv provider loaded\n");
return 0;
}
示例12: g_object_ref
gpointer
g_object_ref (gpointer object)
{
gpointer (* real_g_object_ref) (gpointer);
GObject *obj = G_OBJECT (object);
const char *obj_name;
guint ref_count;
GObject *ret;
real_g_object_ref = get_func ("g_object_ref");
obj_name = G_OBJECT_TYPE_NAME (obj);
ref_count = obj->ref_count;
ret = real_g_object_ref (object);
if (object_filter (obj_name) && display_filter (DISPLAY_FLAG_REFS))
{
g_print (" + Reffed object %p, %s; ref_count: %d -> %d\n",
obj, obj_name, ref_count, obj->ref_count);
print_trace();
}
return ret;
}
示例13: sigquit
void sigquit()
{
print_trace();
printf("My DADDY has Killed me!!!\n");
exit(0);
}
示例14: assert_locked_or_safepoint
void CodeCache::prune_scavenge_root_nmethods() {
assert_locked_or_safepoint(CodeCache_lock);
debug_only(mark_scavenge_root_nmethods());
nmethod* last = NULL;
nmethod* cur = scavenge_root_nmethods();
while (cur != NULL) {
nmethod* next = cur->scavenge_root_link();
debug_only(cur->clear_scavenge_root_marked());
assert(cur->scavenge_root_not_marked(), "");
assert(cur->on_scavenge_root_list(), "else shouldn't be on this list");
if (!cur->is_zombie() && !cur->is_unloaded()
&& cur->detect_scavenge_root_oops()) {
// Keep it. Advance 'last' to prevent deletion.
last = cur;
} else {
// Prune it from the list, so we don't have to look at it any more.
print_trace("prune_scavenge_root", cur);
cur->set_scavenge_root_link(NULL);
cur->clear_on_scavenge_root_list();
if (last != NULL)
last->set_scavenge_root_link(next);
else set_scavenge_root_nmethods(next);
}
cur = next;
}
// Check for stray marks.
debug_only(verify_perm_nmethods(NULL));
}
示例15: guarantee
CodeBlob* CodeCache::allocate(int size) {
// Do not seize the CodeCache lock here--if the caller has not
// already done so, we are going to lose bigtime, since the code
// cache will contain a garbage CodeBlob until the caller can
// run the constructor for the CodeBlob subclass he is busy
// instantiating.
guarantee(size >= 0, "allocation request must be reasonable");
assert_locked_or_safepoint(CodeCache_lock);
CodeBlob* cb = NULL;
_number_of_blobs++;
while (true) {
cb = (CodeBlob*)_heap->allocate(size);
if (cb != NULL) break;
if (!_heap->expand_by(CodeCacheExpansionSize)) {
// Expansion failed
return NULL;
}
if (PrintCodeCacheExtension) {
ResourceMark rm;
tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
(intptr_t)_heap->begin(), (intptr_t)_heap->end(),
(address)_heap->end() - (address)_heap->begin());
}
}
verify_if_often();
print_trace("allocation", cb, size);
return cb;
}