Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new function to check if a tracing container exists
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Sat, 9 Apr 2011 12:32:16 +0000 (14:32 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Sat, 9 Apr 2011 12:32:16 +0000 (14:32 +0200)
src/instr/instr_paje.c
src/instr/instr_private.h
src/instr/instr_resource_utilization.c

index 0d32eda..8b300ed 100644 (file)
@@ -250,6 +250,15 @@ container_t getContainer (const char *name)
   return recursiveGetContainer(name, rootContainer);
 }
 
+int knownContainerWithName (const char *name)
+{
+  if (xbt_dict_get_or_null (allContainers, name)){
+    return 1;
+  }else{
+    return 0;
+  }
+}
+
 container_t getContainerByName (const char *name)
 {
   return (container_t)xbt_dict_get (allContainers, name);
index e3a6778..67d8793 100644 (file)
@@ -206,6 +206,7 @@ extern xbt_dict_t trivaNodeTypes;
 extern xbt_dict_t trivaEdgeTypes;
 container_t newContainer (const char *name, e_container_types kind, container_t father);
 container_t getContainer (const char *name);
+int knownContainerWithName (const char *name);
 container_t getContainerByName (const char *name);
 char *getContainerIdByName (const char *name);
 char *getVariableTypeIdByName (const char *name, type_t father);
index f80332e..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;
@@ -330,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;