Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] replace IS_TRACING by TRACE_is_active() function
[simgrid.git] / src / instr / instr_config.c
index 4a783d8..e83bf2d 100644 (file)
@@ -5,7 +5,7 @@
   * under the terms of the license (GNU LGPL) which comes with this package. */
 
 
-#include "instr/private.h"
+#include "instr/instr_private.h"
 
 #ifdef HAVE_TRACING
 
 #define OPT_TRACING_PLATFORM_METHOD "tracing/platform/method"
 
 static int trace_configured = 0;
+static int trace_active = 0;
+
+void TRACE_activate (void)
+{
+  if (trace_active){
+    THROW0(tracing_error, TRACE_ERROR_ALREADY_ACTIVE,
+           "Tracing is already active.");
+  }
+  trace_active = 1;
+}
+
+void TRACE_desactivate (void)
+{
+  trace_active = 0;
+}
+
+int TRACE_is_active (void)
+{
+  return trace_active;
+}
 
 int TRACE_is_enabled(void)
 {
@@ -238,4 +258,4 @@ void TRACE_help (int detailed)
 #undef OPT_TRACING_FILENAME
 #undef OPT_TRACING_PLATFORM_METHOD
 
-#endif
+#endif /* HAVE_TRACING */