Simplify dump format

This commit is contained in:
Rodrigo Arias 2021-12-16 13:31:07 +01:00
parent 1aae200614
commit 676576f347

15
dump.c
View File

@ -55,7 +55,6 @@ char *tracedir;
static void static void
emit(struct ovni_stream *stream, struct ovni_ev *ev) emit(struct ovni_stream *stream, struct ovni_ev *ev)
{ {
int64_t delta;
uint64_t clock; uint64_t clock;
int i, payloadsize; int i, payloadsize;
@ -64,21 +63,21 @@ emit(struct ovni_stream *stream, struct ovni_ev *ev)
clock = ovni_ev_get_clock(ev); clock = ovni_ev_get_clock(ev);
delta = clock - stream->lastclock; printf("%s.%d.%d %ld %c%c%c",
printf("%s.%d.%d %c %c %c % 20ld % 15ld ",
stream->loom->hostname, stream->loom->hostname,
stream->proc->pid, stream->proc->pid,
stream->thread->tid, stream->thread->tid,
clock,
ev->header.model, ev->header.model,
ev->header.category, ev->header.category,
ev->header.value, ev->header.value);
clock, delta);
payloadsize = ovni_payload_size(ev); payloadsize = ovni_payload_size(ev);
for(i=0; i<payloadsize; i++) if(payloadsize > 0)
{ {
printf("%02x ", ev->payload.u8[i]); printf(" ");
for(i=0; i<payloadsize; i++)
printf(":%02x", ev->payload.u8[i]);
} }
printf("\n"); printf("\n");