Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] give users the possibility to pause/resume all tracing activities
[simgrid.git] / src / instr / instr_interface.c
index 0a80054..5fffd02 100644 (file)
@@ -985,4 +985,32 @@ xbt_dynar_t TRACE_get_edge_types (void)
   return instr_dict_to_dynar (trivaEdgeTypes);
 }
 
+/** \ingroup TRACE_API
+ *  \brief Pauses all tracing activities.
+ *  \see TRACE_resume
+ */
+void TRACE_pause (void)
+{
+  if (!TRACE_is_enabled()){
+    XBT_DEBUG ("Tracing is already paused, therefore do nothing.");
+  }else{
+    XBT_DEBUG ("Tracing is being paused.");
+    instr_pause_tracing();
+  }
+}
+
+/** \ingroup TRACE_API
+ *  \brief Resumes all tracing activities.
+ *  \see TRACE_pause
+ */
+void TRACE_resume (void)
+{
+  if (TRACE_is_enabled()){
+    XBT_DEBUG ("Tracing is already running while trying to resume, therefore do nothing.");
+  }else{
+    XBT_DEBUG ("Tracing is being resumed.");
+    instr_resume_tracing();
+  }
+}
+
 #endif /* HAVE_TRACING */