Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 18 Jul 2017 00:31:29 +0000 (02:31 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 18 Jul 2017 00:31:29 +0000 (02:31 +0200)
src/instr/instr_config.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_values.cpp
src/instr/instr_private.h
src/surf/instr_routing.cpp

index e6eb6f5..82b951f 100644 (file)
@@ -63,6 +63,8 @@ static int trace_precision;
 static bool trace_configured = false;
 static bool trace_active     = false;
 
+static type_t rootType = nullptr;        /* the root type */
+
 instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
 
 static void TRACE_getopts()
@@ -148,9 +150,9 @@ int TRACE_end()
 
     /* destroy all data structures of tracing (and free) */
     PJ_container_free_all();
-    PJ_type_free_all();
+    recursiveDestroyType (PJ_type_get_root());
     PJ_container_release();
-    PJ_type_release();
+    rootType = nullptr;
 
     xbt_dict_free(&user_link_variables);
     xbt_dict_free(&user_host_variables);
index c63641c..cfaf78f 100644 (file)
@@ -154,20 +154,6 @@ PajeEvent:: ~PajeEvent()
 {
   XBT_DEBUG("%s not implemented for %p: event_type=%d, timestamp=%f", __FUNCTION__,
       this, (int)event_type, timestamp);
-//  xbt_backtrace_display_current();
-
- /* switch (event->event_type){
-  case PAJE_StartLink:
-    xbt_free (((startLink_t)(event->data))->value);
-    xbt_free (((startLink_t)(event->data))->key);
-    break;
-  case PAJE_EndLink:
-    xbt_free (((endLink_t)(event->data))->value);
-    xbt_free (((endLink_t)(event->data))->key);
-    break;
-  default:
-    break;
-  }*/
 }
 
 void TRACE_paje_start() {
index 50df528..333e806 100644 (file)
@@ -10,16 +10,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event sy
 
 static type_t rootType = nullptr;        /* the root type */
 
-void PJ_type_alloc ()
-{
-}
-
 void PJ_type_release ()
 {
   rootType = nullptr;
 }
 
-
 type_t PJ_type_get_root ()
 {
   return rootType;
@@ -56,7 +51,11 @@ void PJ_type_free (type_t type)
   char *value_name;
   xbt_dict_cursor_t cursor = nullptr;
   xbt_dict_foreach(type->values, cursor, value_name, value) {
-    PJ_value_free (value);
+     XBT_DEBUG("free value %s, child of %s", value->name, value->father->name);
+     xbt_free(value->name);
+     xbt_free(value->color);
+     xbt_free(value->id);
+     xbt_free(value);
   }
   xbt_dict_free (&type->values);
   xbt_free (type->name);
@@ -67,7 +66,7 @@ void PJ_type_free (type_t type)
   type = nullptr;
 }
 
-static void recursiveDestroyType (type_t type)
+void recursiveDestroyType (type_t type)
 {
   XBT_DEBUG("recursiveDestroyType %s", type->name);
   xbt_dict_cursor_t cursor = nullptr;
@@ -79,12 +78,6 @@ static void recursiveDestroyType (type_t type)
   PJ_type_free(type);
 }
 
-void PJ_type_free_all ()
-{
-  recursiveDestroyType (PJ_type_get_root());
-  rootType = nullptr;
-}
-
 type_t PJ_type_get (const char *name, type_t father)
 {
   type_t ret = PJ_type_get_or_null (name, father);
index 7c0505f..88ad1bb 100644 (file)
@@ -57,12 +57,3 @@ val_t PJ_value_get (const char *name, type_t father)
   }
   return ret;
 }
-
-void PJ_value_free (val_t value)
-{
-  XBT_DEBUG("free value %s, child of %s", value->name, value->father->name);
-  xbt_free(((val_t)value)->name);
-  xbt_free(((val_t)value)->color);
-  xbt_free(((val_t)value)->id);
-  xbt_free(value);
-}
index fbff688..d3d45c2 100644 (file)
@@ -337,7 +337,6 @@ XBT_PUBLIC(void) PJ_container_free_all (void);
 XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container);
 
 /* instr_paje_types.c */
-XBT_PRIVATE void PJ_type_alloc ();
 XBT_PRIVATE void PJ_type_release ();
 XBT_PUBLIC(type_t)  PJ_type_get_root ();
 XBT_PRIVATE type_t PJ_type_container_new (const char *name, type_t father);
@@ -347,14 +346,15 @@ XBT_PRIVATE XBT_PRIVATE type_t PJ_type_variable_new (const char *name, const cha
 XBT_PRIVATE type_t PJ_type_state_new (const char *name, type_t father);
 XBT_PUBLIC(type_t)  PJ_type_get (const char *name, const type_t father);
 XBT_PUBLIC(type_t)  PJ_type_get_or_null (const char *name, type_t father);
-void PJ_type_free_all ();
-XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type);
+XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type); 
+
+/* instr_config.c */
+XBT_PRIVATE void recursiveDestroyType (type_t type);
 
 /* instr_paje_values.c */
 XBT_PUBLIC(val_t)  PJ_value_new (const char *name, const char *color, type_t father);
 XBT_PUBLIC(val_t)  PJ_value_get_or_new (const char *name, const char *color, type_t father);
 XBT_PUBLIC(val_t)  PJ_value_get (const char *name, const type_t father);
-XBT_PRIVATE void PJ_value_free (val_t value);
 
 XBT_PRIVATE void TRACE_TI_start();
 XBT_PRIVATE void TRACE_TI_end();
index d6e4f93..420221a 100644 (file)
@@ -169,7 +169,6 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
 
   if (PJ_container_get_root() == nullptr){
     PJ_container_alloc ();
-    PJ_type_alloc();
     container_t root = PJ_container_new (id, INSTR_AS, nullptr);
     PJ_container_set_root (root);