#include <stdint.h>
#include <stdio.h>
#include <time.h>
+#include "qemu-timer.h"
#include "trace.h"
/** Trace file header event ID */
uint64_t x4, uint64_t x5, uint64_t x6)
{
TraceRecord *rec = &trace_buf[trace_idx];
- struct timespec ts;
-
- /* TODO Windows? It would be good to use qemu-timer here but that isn't
- * linked into qemu-tools. Also we should avoid recursion in the tracing
- * code, therefore it is useful to be self-contained.
- */
- clock_gettime(CLOCK_MONOTONIC, &ts);
if (!trace_list[event].state) {
return;
}
rec->event = event;
- rec->timestamp_ns = ts.tv_sec * 1000000000LL + ts.tv_nsec;
+ rec->timestamp_ns = get_clock();
rec->x1 = x1;
rec->x2 = x2;
rec->x3 = x3;
unsigned int i;
for (i = 0; i < trace_idx; i++) {
- stream_printf(stream, "Event %lu : %lx %lx %lx %lx %lx\n",
+ stream_printf(stream, "Event %" PRIu64 " : %" PRIx64 " %" PRIx64
+ " %" PRIx64 " %" PRIx64 " %" PRIx64 " %" PRIx64 "\n",
trace_buf[i].event, trace_buf[i].x1, trace_buf[i].x2,
- trace_buf[i].x3, trace_buf[i].x4, trace_buf[i].x5);
+ trace_buf[i].x3, trace_buf[i].x4, trace_buf[i].x5,
+ trace_buf[i].x6);
}
}