Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
enough playing with instr for now ...
[simgrid.git] / src / instr / instr_config.cpp
index 598aa40..6c837b2 100644 (file)
@@ -63,8 +63,6 @@ static int trace_precision;
 static bool trace_configured = false;
 static bool trace_active     = false;
 
-static simgrid::instr::Type* rootType = nullptr; /* the root type */
-
 instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
 
 static void TRACE_getopts()
@@ -141,10 +139,10 @@ int TRACE_end()
     TRACE_last_timestamp_to_dump = surf_get_clock();
     TRACE_paje_dump_buffer(true);
 
+    container_t root = simgrid::instr::Container::getRootContainer();
     /* destroy all data structures of tracing (and free) */
-    delete PJ_container_get_root();
-    delete PJ_type_get_root();
-    rootType = nullptr;
+    delete root;
+    delete root->type_;
 
     /* close the trace files */
     const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
@@ -356,11 +354,10 @@ void TRACE_global_init()
 
 static void print_line (const char *option, const char *desc, const char *longdesc, int detailed)
 {
-  char str[INSTR_DEFAULT_STR_SIZE];
-  snprintf (str, INSTR_DEFAULT_STR_SIZE, "--cfg=%s ", option);
+  std::string str = std::string("--cfg=") + option + " ";
 
-  int len = strlen (str);
-  printf ("%s%*.*s %s\n", str, 30-len, 30-len, "", desc);
+  int len = str.size();
+  printf("%s%*.*s %s\n", str.c_str(), 30 - len, 30 - len, "", desc);
   if (longdesc != nullptr && detailed){
     printf ("%s\n\n", longdesc);
   }