X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/976ee462f4626798ebf76ca46d13f53e10e0e28d..652114f194de013d00c485df901535bc83acb73b:/src/surf/trace_mgr.c diff --git a/src/surf/trace_mgr.c b/src/surf/trace_mgr.c index 0ebe38fb57..fba9362909 100644 --- a/src/surf/trace_mgr.c +++ b/src/surf/trace_mgr.c @@ -1,6 +1,5 @@ -/* $Id$ */ - -/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2004, 2005, 2007, 2009, 2010. 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. */ @@ -16,7 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_trace, surf, "Surf trace management"); static xbt_dict_t trace_list = NULL; -tmgr_history_t tmgr_history_new(void) +XBT_INLINE tmgr_history_t tmgr_history_new(void) { tmgr_history_t h; @@ -27,14 +26,14 @@ tmgr_history_t tmgr_history_new(void) return h; } -void tmgr_history_free(tmgr_history_t h) +XBT_INLINE void tmgr_history_free(tmgr_history_t h) { xbt_heap_free(h->heap); free(h); } tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, - double periodicity, double timestep) + double periodicity) { tmgr_trace_t trace = NULL; int linecount = 0; @@ -69,9 +68,6 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, if (sscanf(val, "PERIODICITY " "%lg" "\n", &periodicity) == 1) continue; - if (sscanf(val, "TIMESTEP " "%lg" "\n", ×tep) == 1) - continue; - if (sscanf(val, "%lg" " " "%lg" "\n", &event.delta, &event.value) != 2) xbt_die(bprintf ("%s:%d: Syntax error in trace\n%s", id, linecount, input)); @@ -92,8 +88,6 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, if (last_event) last_event->delta = periodicity; - trace->timestep = timestep; - if (!trace_list) trace_list = xbt_dict_new(); @@ -126,7 +120,7 @@ tmgr_trace_t tmgr_trace_new(const char *filename) char *tstr = xbt_str_from_file(f); fclose(f); - trace = tmgr_trace_new_from_string(filename, tstr, 0., 10.); + trace = tmgr_trace_new_from_string(filename, tstr, 0.); xbt_free(tstr); return trace; @@ -147,7 +141,7 @@ tmgr_trace_t tmgr_empty_trace_new(void) return trace; } -void tmgr_trace_free(tmgr_trace_t trace) +XBT_INLINE void tmgr_trace_free(tmgr_trace_t trace) { if (!trace) return; @@ -175,7 +169,7 @@ tmgr_trace_event_t tmgr_history_add_trace(tmgr_history_t h, return trace_event; } -double tmgr_history_next_date(tmgr_history_t h) +XBT_INLINE double tmgr_history_next_date(tmgr_history_t h) { if (xbt_heap_size(h->heap)) return (xbt_heap_maxkey(h->heap)); @@ -218,7 +212,7 @@ tmgr_trace_event_t tmgr_history_get_next_event_leq(tmgr_history_t h, return trace_event; } -void tmgr_finalize(void) +XBT_INLINE void tmgr_finalize(void) { xbt_dict_free(&trace_list); }