LOCAL void mcd_event_put_request(struct domain *d, mcd_event_request_t *req) { mcd_event_front_ring_t *front_ring; RING_IDX req_prod; my_trace() mcd_event_ring_lock(d); front_ring = &d->mcd_event.front_ring; req_prod = front_ring->req_prod_pvt; /* Copy request */ memcpy(RING_GET_REQUEST(front_ring, req_prod), req, sizeof(*req)); req_prod++; /* Update ring */ front_ring->req_prod_pvt = req_prod; RING_PUSH_REQUESTS(front_ring); mcd_event_ring_unlock(d); my_trace() // TODO check whether I have to use notifying through channel or just ring.. ??? notify_via_xen_event_channel(d, d->mcd_event.xen_port); }
int main(int argc, char *argv[]) { int i, count, sum; tracer_config_default(&my_tracer_config); tracer_config_set_path(&my_tracer_config, "tracer.log"); tracer_config_set_max_entries(&my_tracer_config, 1000); tracer_start(&my_tracer, &my_tracer_config); my_trace("opened tracer with %d entries", 1000); count = COUNT; for (i=0; i<count; i++) { values[i] = 3 * i; } my_trace("summing %d values", count); sum = 0; for (i=0; i<count; i++) { my_trace("iteration=%d, value=%d", i, values[i]); sum += values[i]; my_trace(" current sum=%d", sum); if (i == 666) { /* OH NO! */ *(char*)NULL = i; } } my_trace("sum finished: %d", sum); printf("sum is %d\n", sum); }
void load_syms(void) { char sympath[256]; char errbuf[256]; snprintf(sympath, sizeof(sympath), "%s/showtime.syms", showtime_dataroot()); my_trace("sympath: %s\n", sympath); fa_handle_t *fh = fa_open(sympath, errbuf, sizeof(errbuf)); if(fh == NULL) { my_trace("Unable to open symbol file %s -- %s", sympath, errbuf); return; } int size = fa_fsize(fh); char *buf = halloc(size + 1); int r = fa_read(fh, buf, size); if(r != size) { my_trace("Unable to read %d bytes", size); hfree(buf, size+1); } else { buf[size] = 0; my_trace("Loaded symbol table %d bytes to %p", size, buf); symbuf = buf; } fa_close(fh); }