From cf25ea22e105edf1f620d740b628af67c8559f7e Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 15 Aug 2004 21:04:48 +0000 Subject: [PATCH] fixed substraction from start cycle counter : end and start times between blocs tested git-svn-id: http://ltt.polymtl.ca/svn@779 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/tracefile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 6cf54a08..94c9746c 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -1265,19 +1265,19 @@ gboolean ltt_tracefile_pre_read_cycles(LttTracefile *tf) //tf->cur_cycle_count = tf->cur_cycle_count + res_delta_count; tf->cur_cycle_count = cycle_count | ((LttCycleCount)tf->count << 32); - g_debug("cur cycle count %llu", tf->cur_cycle_count); + //g_debug("cur cycle count %llu", tf->cur_cycle_count); if(unlikely(evId == TRACE_BLOCK_START)){ - g_debug("BLOCK START"); + //g_debug("BLOCK START"); }else if(unlikely(evId == TRACE_BLOCK_END)){ - g_debug("BLOCK END"); + //g_debug("BLOCK END"); /* The goal of all this pre reading */ tf->a_block_end->cycle_count = tf->cur_cycle_count; - g_debug("end of block cycle count : %llu", tf->cur_cycle_count); + //g_debug("end of block cycle count : %llu", tf->cur_cycle_count); return FALSE; } @@ -1341,7 +1341,7 @@ int readBlock(LttTracefile * tf, int whichBlock) tf->count = 0; tf->pre_cycle_count = 0; tf->cur_cycle_count = 0; - g_debug("precalculating cycles begin for block %i", whichBlock); + //g_debug("precalculating cycles begin for block %i", whichBlock); while(likely(ltt_tracefile_pre_read_cycles(tf))); /* Rough approximation of cycles per usec to calculate * the real block start and end time. @@ -1350,7 +1350,7 @@ int readBlock(LttTracefile * tf, int whichBlock) /* we are at end position, make end time more precise */ tf->a_block_end->time = getEventTime(tf); - g_debug("precalculating cycles end for block %i", whichBlock); + //g_debug("precalculating cycles end for block %i", whichBlock); /* put back pointer at the beginning */ tf->count = 0; @@ -1538,11 +1538,14 @@ static inline LttTime getEventTime(LttTracefile * tf) // cycle_count += (tf->cur_heart_beat_number - tf->count) << 32; //tf->cur_cycle_count = tf->cur_cycle_count + res_delta_count; + // Total cycle counter of the event. tf->cur_cycle_count = cycle_count | ((LttCycleCount)tf->count << 32); - g_debug("cur cycle count %llu", tf->cur_cycle_count); + //g_debug("cur cycle count %llu", tf->cur_cycle_count); - lEventTotalCycle = tf->cur_cycle_count; + // Total number of cycles since the beginning of the block + lEventTotalCycle = tf->cur_cycle_count + - tf->a_block_start->cycle_count; -- 2.34.1