From d3353231a6d3cd3fa74d2beca45f81d3aaa5a635 Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 12 Oct 2007 13:22:09 +0000 Subject: [PATCH] fix compact events git-svn-id: http://ltt.polymtl.ca/svn@2669 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/trace.h | 1 - ltt/branches/poly/ltt/tracefile.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ltt/branches/poly/ltt/trace.h b/ltt/branches/poly/ltt/trace.h index 05a8133c..6e1cea17 100644 --- a/ltt/branches/poly/ltt/trace.h +++ b/ltt/branches/poly/ltt/trace.h @@ -42,7 +42,6 @@ struct LttTrace { uint64_t start_monotonic; LttTime start_time; LttTime start_time_from_tsc; - uint8_t compact_event_bits; GData *tracefiles; //tracefiles groups /* Support for markers */ diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index d37c694d..19e0f1cd 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -1769,7 +1769,7 @@ static void print_debug_event_header(LttEvent *ev, void *start_pos, void *end_po if (offset + ((i * 4) + j) < (long)end_pos - (long)start_pos) g_printf("%02hhX", - ((char*)ev->tracefile->buffer.head)[ev->offset + offset + ((i * 4) + j)]); + ((char*)start_pos)[offset + ((i * 4) + j)]); else g_printf(" "); g_printf(" "); @@ -1828,9 +1828,9 @@ int ltt_tracefile_read_update_event(LttTracefile *tf) /* We keep the LSB of the previous timestamp, to make sure * we never go back */ event->event_id = event->timestamp >> tf->tscbits; - event->event_id = event->event_id & ((1 << tf->trace->compact_event_bits) - 1); + event->event_id = event->event_id & ((1 << tf->compact_event_bits) - 1); event->compact_data = event->timestamp >> - (tf->trace->compact_event_bits + tf->tscbits); + (tf->compact_event_bits + tf->tscbits); //printf("tsc bits %u, ev bits %u init data %u\n", // tf->tscbits, tf->trace->compact_event_bits, event->compact_data); /* Put the compact data back in original endianness */ -- 2.34.1