Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] adding new way of set user variables for links, by providing src and dst
[simgrid.git] / src / instr / instr_interface.c
index df4d026..17515ef 100644 (file)
@@ -9,6 +9,7 @@
 #ifdef HAVE_TRACING
 
 #include "instr/instr_private.h"
+#include "surf/network_private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
 
@@ -135,6 +136,23 @@ void TRACE_user_variable(double time,
   }
 }
 
+void TRACE_user_srcdst_variable(double time,
+                              const char *src,
+                              const char *dst,
+                              const char *variable,
+                              const char *father_type,
+                              double value,
+                              InstrUserVariable what)
+{
+  xbt_dynar_t route = global_routing->get_route (src, dst);
+  unsigned int i;
+  void *link;
+  xbt_dynar_foreach (route, i, link) {
+    char *link_name = ((link_CM02_t)link)->lmm_resource.generic_resource.name;
+    TRACE_user_variable (time, link_name, variable, father_type, value, what);
+  }
+}
+
 const char *TRACE_node_name (xbt_node_t node)
 {
   void *data = xbt_graph_node_get_data(node);