Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use s4u API in example.
[simgrid.git] / src / instr / instr_paje_containers.cpp
index 5d194eb..3316dbd 100644 (file)
@@ -7,13 +7,6 @@
 #include "simgrid/s4u/Host.hpp"
 #include "src/instr/instr_private.hpp"
 #include "surf/surf.h"
-#include <sys/stat.h>
-#ifdef WIN32
-#include <direct.h> // _mkdir
-#endif
-
-#include <iomanip> /** std::setprecision **/
-#include <sstream>
 #include <unordered_map>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_containers, instr, "Paje tracing event system (containers)");
@@ -47,7 +40,7 @@ namespace simgrid {
 namespace instr {
 
 Container::Container(std::string name, e_container_types kind, Container* father)
-    : name_(name), kind_(kind), father_(father)
+    : kind_(kind), name_(name), father_(father)
 {
   static long long int container_id = 0;
   id_                               = std::to_string(container_id); // id (or alias) of the container
@@ -98,14 +91,11 @@ Container::Container(std::string name, e_container_types kind, Container* father
   }
 
   if (father_) {
-    type_ = father_->type_->getChildOrNull(typeNameBuff);
-    if (type_ == nullptr) {
-      type_ = Type::containerNew(typeNameBuff.c_str(), father_->type_);
-    }
+    type_ = father_->type_->getOrCreateContainerType(typeNameBuff);
     father_->children_.insert({name_, this});
     logCreation();
   } else if (kind_ == INSTR_AS) {
-    type_ = Type::containerNew("0", nullptr);
+    type_ = Type::createRootType();
   }
 
   //register all kinds by name
@@ -130,7 +120,7 @@ Container::~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(1);
+  TRACE_paje_dump_buffer(true);
 
   // trace my destruction
   if (not TRACE_disable_destroy() && this != PJ_container_get_root()) {