rootContainer = root;
}
-static long long int newTypeId ()
-{
- static long long int counter = 0;
- return counter++;
-}
-
static type_t newType (const char *typename, const char *key, const char *color, e_entity_types kind, type_t father)
{
type_t ret = xbt_new0(s_type_t, 1);
ret->children = xbt_dict_new ();
ret->color = xbt_strdup (color);
- long long int id = newTypeId();
+ static long long int type_id = 0;
char str_id[INSTR_DEFAULT_STR_SIZE];
- snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", id);
+ snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", type_id++);
ret->id = xbt_strdup (str_id);
if (father != NULL){
return ret;
}
-
-static long long int newContainedId ()
-{
- static long long counter = 0;
- return counter++;
-}
-
container_t newContainer (const char *name, e_container_types kind, container_t father)
{
- long long int counter = newContainedId();
+ static long long int container_id = 0;
char id_str[INSTR_DEFAULT_STR_SIZE];
- snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
+ snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", container_id++);
container_t new = xbt_new0(s_container_t, 1);
new->name = xbt_strdup (name); // name of the container
container_t getContainerByName (const char *name)
{
- return (container_t)xbt_dict_get (allContainers, name);
+ return (container_t)xbt_dict_get_or_null (allContainers, name);
}
char *getContainerIdByName (const char *name)
return NULL;
}
-type_t getType (const char *name)
+type_t getType (const char *name, type_t father)
{
- return recursiveGetType (name, rootType);
+ return recursiveGetType (name, father);
}
void destroyContainer (container_t container)
DEBUG1("destroy container %s", container->name);
- //trace my destruction
- new_pajeDestroyContainer(container);
-
//obligation to dump previous events because they might
//reference the container that is about to be destroyed
TRACE_last_timestamp_to_dump = surf_get_clock();
- TRACE_paje_dump_buffer(0);
+ TRACE_paje_dump_buffer(1);
+
+ //trace my destruction
+ new_pajeDestroyContainer(container);
//free
xbt_free (container->name);