details:
- if force == 1, no checks: dump and free all events
- specially useful for big platform files (such as g5k)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9342
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
/* dump trace buffer */
TRACE_last_timestamp_to_dump = surf_get_clock();
/* dump trace buffer */
TRACE_last_timestamp_to_dump = surf_get_clock();
- TRACE_paje_dump_buffer();
+ TRACE_paje_dump_buffer(1);
/* destroy all data structures of tracing (and free) */
destroyAllContainers();
/* destroy all data structures of tracing (and free) */
destroyAllContainers();
//obligation to dump previous events because they might
//reference the container that is about to be destroyed
TRACE_last_timestamp_to_dump = surf_get_clock();
//obligation to dump previous events because they might
//reference the container that is about to be destroyed
TRACE_last_timestamp_to_dump = surf_get_clock();
- TRACE_paje_dump_buffer();
+ TRACE_paje_dump_buffer(0);
//free
xbt_free (container->name);
//free
xbt_free (container->name);
double TRACE_last_timestamp_to_dump = 0;
//dumps the trace file until the timestamp TRACE_last_timestamp_to_dump
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)
+void TRACE_paje_dump_buffer (int force)
{
DEBUG2("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
{
DEBUG2("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
- 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;
+ if (force){
+ paje_event_t event;
+ unsigned int i;
+ xbt_dynar_foreach(buffer, i, event){
+ event->print (event);
+ event->free (event);
+ }
+ xbt_dynar_free (&buffer);
+ buffer = xbt_dynar_new (sizeof(paje_event_t), NULL);
+ }else{
+ 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);
- xbt_dynar_remove_at (buffer, 0, &event);
- event->print (event);
- event->free (event);
}
DEBUG1("%s: ends", __FUNCTION__);
}
}
DEBUG1("%s: ends", __FUNCTION__);
}
void TRACE_paje_create_header(void);
void TRACE_paje_start(void);
void TRACE_paje_end(void);
void TRACE_paje_create_header(void);
void TRACE_paje_start(void);
void TRACE_paje_end(void);
-void TRACE_paje_dump_buffer (void);
+void TRACE_paje_dump_buffer (int force);
void new_pajeDefineContainerType(type_t type);
void new_pajeDefineVariableType(type_t type);
void new_pajeDefineStateType(type_t type);
void new_pajeDefineContainerType(type_t type);
void new_pajeDefineVariableType(type_t type);
void new_pajeDefineStateType(type_t type);
currentContainer = NULL;
recursiveGraphExtraction (getRootContainer());
platform_created = 1;
currentContainer = NULL;
recursiveGraphExtraction (getRootContainer());
platform_created = 1;
+ TRACE_paje_dump_buffer(1);
}
void instr_routing_define_callbacks ()
}
void instr_routing_define_callbacks ()
model->model_private->update_actions_state(NOW, min);
#ifdef HAVE_TRACING
model->model_private->update_actions_state(NOW, min);
#ifdef HAVE_TRACING
- TRACE_paje_dump_buffer ();
+ TRACE_paje_dump_buffer (0);