Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
lua layer that reimplements SPLAY methodsfor rpc, job and events modules, with a...
[simgrid.git] / src / instr / instr_resource_utilization.c
index 1e4cdf7..e8273e3 100644 (file)
@@ -291,7 +291,7 @@ void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_acti
   if (!value)
     return;
   //only trace link utilization if link is known by tracing mechanism
-  if (!getContainerByName(resource))
+  if (!knownContainerWithName(resource))
     return;
   if (!value)
     return;
@@ -308,9 +308,12 @@ void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_acti
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
-    XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+    //variable of this category starts by 'b', because we have a link here
+    char category_type[INSTR_DEFAULT_STR_SIZE];
+    snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "b%s", surf_action->category);
+    XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
     container_t container = getContainerByName (resource);
-    type_t type = getVariableType(surf_action->category, NULL, container->type);
+    type_t type = getVariableType(category_type, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
   }
   return;
@@ -327,6 +330,9 @@ void TRACE_surf_host_set_utilization(const char *resource,
 {
   if (!TRACE_is_active())
     return;
+  //only trace host utilization if host is known by tracing mechanism
+  if (!knownContainerWithName(resource))
+    return;
   if (!value)
     return;
 
@@ -342,9 +348,12 @@ void TRACE_surf_host_set_utilization(const char *resource,
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
-    XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+    //variable of this category starts by 'p', because we have a host here
+    char category_type[INSTR_DEFAULT_STR_SIZE];
+    snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", surf_action->category);
+    XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
     container_t container = getContainerByName (resource);
-    type_t type = getVariableType(surf_action->category, NULL, container->type);
+    type_t type = getVariableType(category_type, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
   }
   return;