X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fconvert%2Fconvert.c;h=722bf5ecc9411608ddfafdee57658bad80c2336c;hb=0ff39ce47cf1061ba5880560dd9192336dc1ac64;hp=51f137934da20a649c18a789e9a91a0ad79eeb20;hpb=3fc51411429c805f41ed2e6bf081a853e9fbd5ac;p=lttv.git diff --git a/ltt/branches/poly/ltt/convert/convert.c b/ltt/branches/poly/ltt/convert/convert.c index 51f13793..722bf5ec 100644 --- a/ltt/branches/poly/ltt/convert/convert.c +++ b/ltt/branches/poly/ltt/convert/convert.c @@ -293,12 +293,13 @@ int main(int argc, char ** argv){ cur_pos += sizeof(uint16_t); //Skip event size evId = *(uint8_t *)cur_pos; - cur_pos += sizeof(uint8_t); - if(*(uint32_t*)cur_pos != TRACER_MAGIC_NUMBER) - g_error("Trace magic number does not match : %lx, should be %lx", - (uint32_t*)cur_pos, TRACER_MAGIC_NUMBER); - cur_pos += sizeof(uint32_t); + g_assert(evId == TRACE_START); + cur_pos += sizeof(uint8_t); //skip EvId + cur_pos += sizeof(uint32_t); //skip time delta tStart = (trace_start_any*)cur_pos; + if(tStart->MagicNumber != TRACER_MAGIC_NUMBER) + g_error("Trace magic number does not match : %lx, should be %lx", + tStart->MagicNumber, TRACER_MAGIC_NUMBER); if(tStart->MajorVersion != TRACER_SUP_VERSION_MAJOR) g_error("Trace Major number does match : %hu, should be %u", tStart->MajorVersion, TRACER_SUP_VERSION_MAJOR); @@ -312,6 +313,10 @@ int main(int argc, char ** argv){ start.block_id = tBufStart->ID; end.block_id = start.block_id; + + g_printf("Trace version %hu.%hu detected\n", + tStart->MajorVersion, + tStart->MinorVersion); if(tStart->MinorVersion == 2) { trace_start_2_2* tStart_2_2 = (trace_start_2_2*)tStart; ltt_major_version = tStart_2_2->MajorVersion;