Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Now it works (if you don't look at the leaks)
[simgrid.git] / src / instr / instr_paje_trace.cpp
index 8cec105..8843d09 100644 (file)
@@ -7,6 +7,7 @@
 #include "src/instr/instr_private.h"
 #include "xbt/virtu.h" /* sg_cmdline */
 #include <sstream>
+#include <vector>
 #include <iomanip> /** std::setprecision **/
 #include "simgrid/sg_config.h"
 
@@ -17,6 +18,19 @@ extern s_instr_trace_writer_t active_writer;
 
 static std::stringstream stream;
 
+void buffer_debug(std::vector<PajeEvent*> *buf);
+void buffer_debug(std::vector<PajeEvent*> *buf) {
+  return;
+  XBT_DEBUG(">>>>>> Dump the state of the buffer. %zu events", buf->size());
+  for (auto event :*buf){
+    event->print();
+    XBT_DEBUG("%p %s", event, stream.str().c_str());
+    stream.str("");
+    stream.clear();
+  }
+  XBT_DEBUG("<<<<<<");
+}
+
 static void print_paje_debug(std::string functionName, PajeEvent* event) {
   XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
             event->timestamp);
@@ -30,6 +44,7 @@ static void init_stream(PajeEvent* event) {
 static void print_row() {
   stream << std::endl;
   fprintf(tracing_file, "%s", stream.str().c_str());
+  XBT_DEBUG("Dump %s", stream.str().c_str());
   stream.str("");
   stream.clear();
 }