From 0e122455d70fcfba94edf8c19f9eff478461b32c Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 17 Aug 2004 15:44:26 +0000 Subject: [PATCH] uh-ohhhh, heartbeat doesn't happen at least once per overflow. Check overflow at EACH event... git-svn-id: http://ltt.polymtl.ca/svn@801 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/convert/convert.c | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/ltt/branches/poly/ltt/convert/convert.c b/ltt/branches/poly/ltt/convert/convert.c index a13daaf2..58957f4d 100644 --- a/ltt/branches/poly/ltt/convert/convert.c +++ b/ltt/branches/poly/ltt/convert/convert.c @@ -480,8 +480,20 @@ int main(int argc, char ** argv){ //write event_id and time_delta write_to_buffer(write_pos,(void*)&newId,sizeof(uint16_t)); write_to_buffer(write_pos,(void*)&time_delta, sizeof(uint32_t)); - + + /* Fix (Mathieu) */ + if(time_delta < (0xFFFFFFFFULL&adaptation_tsc)) { + /* Overflow */ + adaptation_tsc = (adaptation_tsc&0xFFFFFFFF00000000ULL) + 0x100000000ULL + + (uint64_t)time_delta; + } else { + /* No overflow */ + adaptation_tsc = (adaptation_tsc&0xFFFFFFFF00000000ULL) + time_delta; + } + + if(evId == TRACE_BUFFER_END){ +#if 0 /* Fix (Mathieu) */ if(time_delta < (0xFFFFFFFFULL&adaptation_tsc)) { /* Overflow */ @@ -491,7 +503,7 @@ int main(int argc, char ** argv){ /* No overflow */ adaptation_tsc = (adaptation_tsc&0xFFFFFFFF00000000ULL) + time_delta; } - +#endif //0 end.cycle_count = adaptation_tsc; int size = (void*)buf_out + block_size - write_pos - sizeof(buffer_end) - sizeof(uint32_t); @@ -609,16 +621,6 @@ int main(int argc, char ** argv){ event_size = sizeof(trace_network); break; case TRACE_HEARTBEAT: - /* Fix (Mathieu) */ - if(time_delta < (0xFFFFFFFFULL&adaptation_tsc)) { - /* Overflow */ - adaptation_tsc = (adaptation_tsc&0xFFFFFFFF00000000ULL) + 0x100000000ULL - + (uint64_t)time_delta; - } else { - /* No overflow */ - adaptation_tsc = (adaptation_tsc&0xFFFFFFFF00000000ULL) + time_delta; - } - beat.seconds = 0; beat.nanoseconds = 0; beat.cycle_count = adaptation_tsc; -- 2.34.1