X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/92959d5b26387e5194b1bb4553baf90da7701f41..97c23c35d161c99ba16870289149a69583e40abc:/src/instr/instr_trace.c diff --git a/src/instr/instr_trace.c b/src/instr/instr_trace.c index 02de93aaf5..8481697cda 100644 --- a/src/instr/instr_trace.c +++ b/src/instr/instr_trace.c @@ -1,8 +1,8 @@ -/* Copyright (c) 2010-2013. The SimGrid Team. +/* Copyright (c) 2010-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ + * under the terms of the license (GNU LGPL) which comes with this package. */ #include "instr/instr_private.h" #include "xbt/virtu.h" /* sg_cmdline */ @@ -27,8 +27,6 @@ s_instr_trace_writer_t active_writer = { print_NULL, print_NULL }; - - xbt_dynar_t buffer = NULL; void dump_comment (const char *comment) @@ -59,8 +57,15 @@ void dump_comment_file (const char *filename) fclose(file); } +void TRACE_init() +{ + buffer = xbt_dynar_new(sizeof(paje_event_t), NULL); +} - +void TRACE_finalize() +{ + xbt_dynar_free(&buffer); +} double TRACE_last_timestamp_to_dump = 0; //dumps the trace file until the timestamp TRACE_last_timestamp_to_dump @@ -101,6 +106,7 @@ static void insert_into_buffer (paje_event_t tbi) tbi->free (tbi); return; } + XBT_DEBUG("%s: insert event_type=%d, timestamp=%f, buffersize=%lu)", __FUNCTION__, (int)tbi->event_type, tbi->timestamp, xbt_dynar_length(buffer));