Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
only need src and dst_name when tracing
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 28 Sep 2010 14:55:50 +0000 (14:55 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 28 Sep 2010 14:55:50 +0000 (14:55 +0000)
details:
- set these variables when surf action is created
- free them when action is net_action_unref

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8293 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/network.c
src/surf/network_private.h

index 3e1f2f0..de80963 100644 (file)
@@ -255,6 +255,10 @@ static int net_action_unref(surf_action_t action)
     if (((surf_action_network_CM02_t) action)->variable)
       lmm_variable_free(network_maxmin_system,
                         ((surf_action_network_CM02_t) action)->variable);
+#ifdef HAVE_TRACING
+    xbt_free (((surf_action_network_CM02_t)action)->src_name);
+    xbt_free (((surf_action_network_CM02_t)action)->dst_name);
+#endif
     free(action);
     return 1;
   }
@@ -583,7 +587,13 @@ static surf_action_t net_communicate(const char *src_name, const char *dst_name,
   }  /* LARGE PLATFORMS HACK:
      expand also with src->link and dst->link */
 
+#ifdef HAVE_TRACING
+  action->src_name = xbt_new (char, strlen(src_name)+1);
+  strncpy (action->src_name, src_name, strlen(src_name)+1);
 
+  action->dst_name = xbt_new (char, strlen(dst_name)+1);
+  strncpy (action->dst_name, dst_name, strlen(dst_name)+1);
+#endif
 
   XBT_OUT;
 
index ff198b5..ad2af8e 100644 (file)
@@ -29,8 +29,11 @@ typedef struct surf_action_network_CM02 {
   double rate;
   int latency_limited;
   int suspended;
+
+#ifdef HAVE_TRACING
   char* src_name;
   char* dst_name;
+#endif
   
 } s_surf_action_network_CM02_t, *surf_action_network_CM02_t;