Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] Guard expensive computations with TRACE_is_active.
[simgrid.git] / src / surf / network_im.c
index 3b1e091..38513f4 100644 (file)
@@ -781,9 +781,12 @@ static surf_action_t im_net_communicate(const char *src_name,
   /* LARGE PLATFORMS HACK:
      expand also with src->link and dst->link */
 #ifdef HAVE_TRACING
-  action->src_name = xbt_strdup(src_name);
-
-  action->dst_name = xbt_strdup(dst_name);
+  if (TRACE_is_active()) {
+    action->src_name = xbt_strdup(src_name);
+    action->dst_name = xbt_strdup(dst_name);
+  } else {
+    action->src_name = action->dst_name = NULL;
+  }
 #endif
 
   xbt_dynar_free(&route);