Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] let paje output its own header
[simgrid.git] / src / instr / instr_resource_utilization.c
index d68cb87..b18ea88 100644 (file)
@@ -37,7 +37,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now,
     xbt_dynar_t array = xbt_dynar_new(sizeof(char *), xbt_free);
     char *var_cpy = xbt_strdup(variable);
     xbt_dynar_push(array, &var_cpy);
-    if (IS_TRACING_PLATFORM)
+    if (TRACE_platform_is_enabled())
       pajeSetVariable(now, variable, resource, "0");
     xbt_dict_set(platform_variables, resource, array,
                  xbt_dynar_free_voidp);
@@ -54,7 +54,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now,
     if (flag == 0) {
       char *var_cpy = xbt_strdup(variable);
       xbt_dynar_push(array, &var_cpy);
-      if (IS_TRACING_PLATFORM)
+      if (TRACE_platform_is_enabled())
         pajeSetVariable(now, variable, resource, "0");
     }
   }
@@ -79,9 +79,6 @@ static void __TRACE_A_event(smx_action_t action, double now, double delta,
                             const char *variable, const char *resource,
                             double value)
 {
-  if (!IS_TRACING_PLATFORM)
-    return;
-
   char valuestr[100];
   snprintf(valuestr, 100, "%f", value);
 
@@ -104,9 +101,6 @@ static void __TRACE_B_alloc(void)
 
 static void __TRACE_B_release(void)
 {
-  if (!IS_TRACING_PLATFORM)
-    return;
-
   char *key, *time;
   xbt_dict_cursor_t cursor = NULL;
   xbt_dict_foreach(method_b_dict, cursor, key, time) {
@@ -132,9 +126,6 @@ static void __TRACE_B_event(smx_action_t action, double now, double delta,
                             const char *variable, const char *resource,
                             double value)
 {
-  if (!IS_TRACING_PLATFORM)
-    return;
-
   char key_time[INSTR_DEFAULT_STR_SIZE];
   char key_value[INSTR_DEFAULT_STR_SIZE];
   char nowstr[INSTR_DEFAULT_STR_SIZE];
@@ -299,7 +290,7 @@ void TRACE_surf_link_set_utilization(void *link, smx_action_t smx_action,
   }
 
   //trace categorized utilization
-  if (!IS_TRACED(surf_action))
+  if (!surf_action->category)
     return;
   char type[100];
   snprintf(type, 100, "b%s", surf_action->category);
@@ -329,7 +320,7 @@ void TRACE_surf_host_set_utilization(const char *name,
   }
 
   //trace categorized utilization
-  if (!IS_TRACED(surf_action))
+  if (!surf_action->category)
     return;
   char type[100];
   snprintf(type, 100, "p%s", surf_action->category);