Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] limiting the dumping of buffered events to a given timestamp
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 29 Dec 2010 11:38:00 +0000 (11:38 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 29 Dec 2010 11:38:00 +0000 (11:38 +0000)
details:
- the given timestamp is the one of variable TRACE_last_timestamp_to_dump
- this allows a better control of the dumping, so the tracing system
can dump at the same time it assures a perfectly time-ordered trace file

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9328 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/instr_paje_trace.c

index c85021d..285f951 100644 (file)
@@ -168,10 +168,16 @@ void TRACE_paje_end(void)
   DEBUG1("Filename %s is closed", filename);
 }
 
+double TRACE_last_timestamp_to_dump = 0;
+//dumps the trace file until the timestamp TRACE_last_timestamp_to_dump
 void TRACE_paje_dump_buffer (void)
 {
   paje_event_t event;
   while (xbt_dynar_length (buffer) > 0){
+    double head_timestamp = (*(paje_event_t*)xbt_dynar_get_ptr(buffer, 0))->timestamp;
+    if (head_timestamp > TRACE_last_timestamp_to_dump){
+      break;
+    }
     xbt_dynar_remove_at (buffer, 0, &event);
     event->print (event);
     event->free (event);