From 0c2dc6dc3c7fc067faf6f53f15f8c1a43f506122 Mon Sep 17 00:00:00 2001 From: schnorr Date: Wed, 29 Dec 2010 11:38:00 +0000 Subject: [PATCH] [trace] limiting the dumping of buffered events to a given timestamp 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/instr/instr_paje_trace.c b/src/instr/instr_paje_trace.c index c85021df3e..285f951303 100644 --- a/src/instr/instr_paje_trace.c +++ b/src/instr/instr_paje_trace.c @@ -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); -- 2.20.1