Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[NS3, trace] categorized resource utilization active also for NS3
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Mon, 5 Sep 2011 14:58:34 +0000 (16:58 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Thu, 8 Sep 2011 14:56:11 +0000 (16:56 +0200)
src/surf/network_ns3.c

index 095f401..b9f2de5 100644 (file)
@@ -349,6 +349,13 @@ static int ns3_get_link_latency_limited(surf_action_t action)
 }
 #endif
 
 }
 #endif
 
+#ifdef HAVE_TRACING
+static void ns3_action_set_category(surf_action_t action, const char *category)
+{
+  action->category = xbt_strdup (category);
+}
+#endif
+
 void surf_network_model_init_NS3(const char *filename)
 {
        if (surf_network_model)
 void surf_network_model_init_NS3(const char *filename)
 {
        if (surf_network_model)
@@ -370,6 +377,10 @@ void surf_network_model_init_NS3(const char *filename)
        surf_network_model->action_unref = action_unref;
        surf_network_model->extension.network.communicate = ns3_communicate;
 
        surf_network_model->action_unref = action_unref;
        surf_network_model->extension.network.communicate = ns3_communicate;
 
+#ifdef HAVE_TRACING
+  surf_network_model->set_category = ns3_action_set_category;
+#endif
+
        /* Added the initialization for NS3 interface */
 
        if (ns3_initialize(xbt_cfg_get_string(_surf_cfg_set,"ns3/TcpModel"))) {
        /* Added the initialization for NS3 interface */
 
        if (ns3_initialize(xbt_cfg_get_string(_surf_cfg_set,"ns3/TcpModel"))) {