Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
pre version hierarchical routing, fix memory leak
[simgrid.git] / src / instr / interface.c
index 1d87e24..7c42143 100644 (file)
@@ -89,6 +89,7 @@ int TRACE_start ()
   defined_types = xbt_dict_new();
   created_categories = xbt_dict_new();
   __TRACE_msg_init();
+  __TRACE_category_init ();
   __TRACE_surf_init();
   __TRACE_msg_process_init ();
   __TRACE_smpi_init ();
@@ -195,4 +196,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 */