Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
registering the source and destination of all onelink routes
[simgrid.git] / src / instr / interface.c
index 1d87e24..3f998aa 100644 (file)
@@ -53,6 +53,8 @@ int TRACE_start ()
     pajeDefineVariableType ("power", "HOST", "power");
     pajeDefineVariableType ("bandwidth", "LINK", "bandwidth");
     pajeDefineVariableType ("latency", "LINK", "latency");
+    pajeDefineEventType ("source", "LINK", "source");
+    pajeDefineEventType ("destination", "LINK", "destination");
   }
 
   if (IS_TRACING_PROCESSES || IS_TRACING_VOLUME){
@@ -89,7 +91,8 @@ int TRACE_start ()
   defined_types = xbt_dict_new();
   created_categories = xbt_dict_new();
   __TRACE_msg_init();
-  __TRACE_surf_init();
+  __TRACE_category_init ();
+  TRACE_surf_init();
   __TRACE_msg_process_init ();
   __TRACE_smpi_init ();
 
@@ -195,4 +198,18 @@ void TRACE_mark (const char *mark_type, const char *mark_value)
   pajeNewEvent (MSG_get_clock(), mark_type, "0", mark_value);
 }
 
+int TRACE_smpi_set_category (const char *category)
+{
+  //if category is NULL, trace of platform is disabled
+  if (!IS_TRACING) return 1;
+  if (category != NULL){
+    int ret = TRACE_category (category);
+    __TRACE_category_set (SIMIX_process_self(), category);
+    return ret;
+  }else{
+    __TRACE_category_unset (SIMIX_process_self());
+    return 0;
+  }
+}
+
 #endif /* HAVE_TRACING */