- tmgr_trace_t trace = NULL;
-
- if ((!filename) || (strcmp(filename, "") == 0))
- return NULL;
-
- if (trace_list) {
- trace = (tmgr_trace_t)xbt_dict_get_or_null(trace_list, filename);
- if (trace) {
- XBT_WARN("Ignoring redefinition of trace %s", filename);
- return trace;
- }
- }
-
- FILE *f = surf_fopen(filename, "r");
- xbt_assert(f != NULL,
- "Cannot open file '%s' (path=%s)", filename, xbt_str_join(surf_path, ":"));
-
- char *tstr = xbt_str_from_file(f);
- fclose(f);
- trace = tmgr_trace_new_from_string(filename, tstr, 0.);
- xbt_free(tstr);
-
- return trace;
-}
-
-tmgr_trace_t tmgr_empty_trace_new(void)
-{
- tmgr_trace_t trace = NULL;
- s_tmgr_event_t event;
+ xbt_assert(filename && filename[0], "Cannot parse a trace from the null or empty filename");
+ xbt_assert(trace_list.find(filename) == trace_list.end(), "Refusing to define trace %s twice", filename);