Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] only update power and bandwidth if trace subsystem is configured to trace...
[simgrid.git] / src / instr / instr_surf.c
index a79ecab..9faf3a8 100644 (file)
@@ -24,22 +24,20 @@ void TRACE_surf_release(void)
 
 void TRACE_surf_host_set_power(double date, const char *resource, double power)
 {
-  if (!TRACE_is_enabled())
-    return;
-
-  container_t container = PJ_container_get(resource);
-  type_t type = PJ_type_get ("power", container->type);
-  new_pajeSetVariable(date, container, type, power);
+  if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
+    container_t container = PJ_container_get(resource);
+    type_t type = PJ_type_get ("power", container->type);
+    new_pajeSetVariable(date, container, type, power);
+  }
 }
 
 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
 {
-  if (!TRACE_is_enabled())
-    return;
-
-  container_t container = PJ_container_get(resource);
-  type_t type = PJ_type_get ("bandwidth", container->type);
-  new_pajeSetVariable(date, container, type, bandwidth);
+  if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
+    container_t container = PJ_container_get(resource);
+    type_t type = PJ_type_get ("bandwidth", container->type);
+    new_pajeSetVariable(date, container, type, bandwidth);
+  }
 }
 
 /* to trace gtnets */