Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove DefineContainerEvent
[simgrid.git] / src / instr / instr_paje_trace.cpp
index ae772d9..b520463 100644 (file)
@@ -21,8 +21,6 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_trace, instr, "tracing event system");
 
-extern s_instr_trace_writer_t active_writer;
-
 static std::stringstream stream;
 FILE *tracing_file = nullptr;
 
@@ -35,10 +33,6 @@ void print_NULL(PajeEvent* event){}
 /* The active set of functions for the selected trace format
  * By default, they all do nothing, hence the print_NULL to avoid segfaults */
 
-s_instr_trace_writer_t active_writer = {&print_NULL, &print_NULL, &print_NULL, &print_NULL, &print_NULL, &print_NULL,
-                                        &print_NULL, &print_NULL, &print_NULL, &print_NULL, &print_NULL, &print_NULL,
-                                        &print_NULL, &print_NULL, &print_NULL, &print_NULL, &print_NULL, &print_NULL};
-
 std::vector<PajeEvent*> buffer;
 void buffer_debug(std::vector<PajeEvent*> *buf);
 
@@ -218,23 +212,16 @@ void TRACE_paje_end() {
   XBT_DEBUG("Filename %s is closed", filename);
 }
 
-DefineContainerEvent::DefineContainerEvent(type_t type)
+void DefineContainerEvent(type_t type)
 {
-
-  event_type                            = PAJE_DefineContainerType;
-  timestamp                             = 0;
-  this->type = type;
+  e_event_type event_type                            = PAJE_DefineContainerType;
+  double timestamp                             = 0;
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type);
   //print it
-  print ();
-       delete this;
-}
-
-void DefineContainerEvent::print() {
-       if (instr_fmt_type == instr_fmt_paje) {
+  if (instr_fmt_type == instr_fmt_paje) {
                XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
                stream << std::fixed << std::setprecision(TRACE_precision());
-               stream << (int)this->event_type;
+               stream << (int)event_type;
                stream << " " << type->id
                                << " " << type->father->id
                                << " " << type->name;
@@ -244,9 +231,11 @@ void DefineContainerEvent::print() {
        } else {
                THROW_IMPOSSIBLE;
        }
+  //--
 }
 
 
+
 DefineVariableTypeEvent::DefineVariableTypeEvent(type_t type)
 {
   this->event_type                           = PAJE_DefineVariableType;
@@ -845,6 +834,11 @@ void ResetStateEvent::print() {
   }
 }
 
+StartLinkEvent::~StartLinkEvent()
+{
+  free(value);
+  free(key);
+}
 StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
     type_t type, container_t sourceContainer, const char *value, const char *key)
   : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
@@ -904,7 +898,11 @@ EndLinkEvent::EndLinkEvent (double timestamp, container_t container, type_t type
   insert_into_buffer (this);
 }
 
-
+EndLinkEvent::~EndLinkEvent()
+{
+  free(value);
+  free(key);
+}
 void EndLinkEvent::print() {
   if (instr_fmt_type == instr_fmt_paje) {
     XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);