Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] undef constants used only in this source file to avoid re-use elsewhere
[simgrid.git] / src / instr / instr_config.c
index 87f1540..55dd066 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifdef HAVE_TRACING
 
+#define OPT_TRACING               "tracing"
 #define OPT_TRACING_SMPI          "tracing/smpi"
 #define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
 #define OPT_TRACING_PLATFORM      "tracing/platform"
 
 static int trace_configured = 0;
 
+int TRACE_is_enabled(void)
+{
+  return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING);
+}
+
 int TRACE_is_configured(void)
 {
   return trace_configured;
@@ -80,6 +86,13 @@ void TRACE_global_init(int *argc, char **argv)
                    xbt_cfgelm_string, &default_tracing_filename, 1, 1,
                    NULL, NULL);
 
+  /* tracing */
+  int default_tracing = 0;
+  xbt_cfg_register(&_surf_cfg_set, OPT_TRACING,
+                   "Enable Tracing.",
+                   xbt_cfgelm_int, &default_tracing, 0, 1,
+                   NULL, NULL);
+
   /* smpi */
   int default_tracing_smpi = 0;
   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI,
@@ -110,7 +123,7 @@ void TRACE_global_init(int *argc, char **argv)
                    NULL, NULL);
 
   /* platform method */
-  char *default_tracing_platform_method = xbt_strdup("b");
+  char *default_tracing_platform_method = xbt_strdup("a");
   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM_METHOD,
                    "Tracing method used to register categorized resource behavior.",
                    xbt_cfgelm_string, &default_tracing_platform_method, 1,
@@ -141,4 +154,15 @@ void TRACE_global_init(int *argc, char **argv)
   trace_configured = 1;
 }
 
+#undef OPT_TRACING
+#undef OPT_TRACING_SMPI
+#undef OPT_TRACING_SMPI_GROUP
+#undef OPT_TRACING_PLATFORM
+#undef OPT_TRACING_UNCATEGORIZED
+#undef OPT_TRACING_MSG_TASK
+#undef OPT_TRACING_MSG_PROCESS
+#undef OPT_TRACING_MSG_VOLUME
+#undef OPT_TRACING_FILENAME
+#undef OPT_TRACING_PLATFORM_METHOD
+
 #endif