Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] configuration option tracing/platform renamed to tracing/categorized
[simgrid.git] / src / instr / instr_config.c
index f8a58a7c0c3a2676302f9873ec84bae81a9421f8..eebe5bca6511953a5538415669450834b6cbb997 100644 (file)
@@ -9,10 +9,13 @@
 
 #ifdef HAVE_TRACING
 
+XBT_LOG_NEW_CATEGORY(instr, "Logging the behavior of the tracing system (used for Visualization/Analysis of simulations)");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
+
 #define OPT_TRACING               "tracing"
 #define OPT_TRACING_SMPI          "tracing/smpi"
 #define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
-#define OPT_TRACING_PLATFORM      "tracing/platform"
+#define OPT_TRACING_PLATFORM      "tracing/categorized"
 #define OPT_TRACING_UNCATEGORIZED "tracing/uncategorized"
 #define OPT_TRACING_MSG_TASK      "tracing/msg/task"
 #define OPT_TRACING_MSG_PROCESS   "tracing/msg/process"
@@ -29,16 +32,15 @@ extern xbt_dict_t created_categories; //declared in instr_interface.c
 
 void TRACE_activate (void)
 {
-  if (trace_active){
-    THROW0(tracing_error, TRACE_ERROR_ALREADY_ACTIVE,
-           "Tracing is already active.");
-  }
+  xbt_assert0 (trace_active==0, "Tracing is already active.");
   trace_active = 1;
+  DEBUG0 ("Tracing is on");
 }
 
 void TRACE_desactivate (void)
 {
   trace_active = 0;
+  DEBUG0 ("Tracing is off");
 }
 
 int TRACE_is_active (void)
@@ -294,10 +296,9 @@ void TRACE_generate_triva_uncat_conf (void)
   char *output = TRACE_get_triva_uncat_conf ();
   if (output && strlen(output) > 0){
     FILE *file = fopen (output, "w");
-    if (!file){
-      THROW1(tracing_error, TRACE_ERROR_FILE_OPEN,
-             "Unable to open file (%s) for writing triva graph configuration (uncategorized).", output);
-    }
+    xbt_assert1 (file != NULL,
+       "Unable to open file (%s) for writing triva graph "
+       "configuration (uncategorized).", output);
     fprintf (file,
         "{\n"
         "  node = (HOST);\n"
@@ -336,16 +337,15 @@ void TRACE_generate_triva_cat_conf (void)
   if (output && strlen(output) > 0){
     //check if we do have categories declared
     if (xbt_dict_length(created_categories) == 0){
-//      INFO0("No categories declared, ignoring generation of triva graph configuration");
+      INFO0("No categories declared, ignoring generation of triva graph configuration");
       return;
     }
     xbt_dict_cursor_t cursor=NULL;
     char *key, *data;
     FILE *file = fopen (output, "w");
-    if (!file){
-      THROW1(tracing_error, TRACE_ERROR_FILE_OPEN,
-             "Unable to open file (%s) for writing triva graph configuration (categorized).", output);
-    }
+    xbt_assert1 (file != NULL,
+       "Unable to open file (%s) for writing triva graph "
+       "configuration (categorized).", output);
     fprintf (file,
         "{\n"
         "  node = (HOST);\n"