X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/850b11f6847edce3023ef068f2df7417691e2df3..8b1e89ea42b81022a55191c256ef3d7dc977803a:/src/surf/surf_routing.cpp diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index b9a584ff9e..c3178459f7 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -13,7 +13,7 @@ #include "simgrid/platf_interface.h" // platform creation API internal interface #include "simgrid/sg_config.h" #include "storage_interface.hpp" - +#include "src/surf/platform.hpp" #include "surf/surfxml_parse_values.h" /************* @@ -206,20 +206,17 @@ void sg_platf_new_trace(sg_platf_trace_cbarg_t trace) tmgr_trace_t tmgr_trace; if (!trace->file || strcmp(trace->file, "") != 0) { tmgr_trace = tmgr_trace_new_from_file(trace->file); - } else if (strcmp(trace->pc_data, "") == 0) { - tmgr_trace = NULL; } else { - tmgr_trace = - tmgr_trace_new_from_string(trace->id, trace->pc_data, - trace->periodicity); + xbt_assert(strcmp(trace->pc_data, ""), + "Trace '%s' must have either a content, or point to a file on disk.",trace->id); + tmgr_trace = tmgr_trace_new_from_string(trace->id, trace->pc_data, trace->periodicity); } xbt_dict_set(traces_set_list, trace->id, (void *) tmgr_trace, NULL); } void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect) { - xbt_assert(xbt_dict_get_or_null - (traces_set_list, trace_connect->trace), + xbt_assert(xbt_dict_get_or_null(traces_set_list, trace_connect->trace), "Cannot connect trace %s to %s: trace unknown", trace_connect->trace, trace_connect->element); @@ -1226,8 +1223,8 @@ static void check_disk_attachment() void routing_register_callbacks() { - sg_platf_postparse_add_cb(routing_parse_postparse); - sg_platf_postparse_add_cb(check_disk_attachment); + simgrid::surf::on_postparse.connect(routing_parse_postparse); + simgrid::surf::on_postparse.connect(check_disk_attachment); instr_routing_define_callbacks(); }