X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f021475d9021fca0a6a72dd499aa1dc5dd1d2448..7b10de9bf6c68575ca0374c70d4505417227d51e:/src/xbt/xbt_replay.cpp diff --git a/src/xbt/xbt_replay.cpp b/src/xbt/xbt_replay.cpp index 40b5cee45a..dcb97ce69d 100644 --- a/src/xbt/xbt_replay.cpp +++ b/src/xbt/xbt_replay.cpp @@ -4,22 +4,14 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "src/internal_config.h" #include "xbt/ex.hpp" #include "xbt/log.h" #include "xbt/replay.hpp" -#include "xbt/str.h" -#include "xbt/sysdep.h" #include -#include -#include -#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(replay,xbt,"Replay trace reader"); -bool is_replay_active = false; - namespace simgrid { namespace xbt { @@ -38,17 +30,12 @@ class ReplayReader { std::string line; public: - char* filename_; - int linenum = 0; - explicit ReplayReader(const char* filename) { - filename_ = xbt_strdup(filename); fs = new std::ifstream(filename, std::ifstream::in); } ~ReplayReader() { - free(filename_); delete fs; } bool get(ReplayAction* action); @@ -57,7 +44,6 @@ public: bool ReplayReader::get(ReplayAction* action) { read_and_trim_line(fs, &line); - linenum++; if (line.length() > 0 && line.find("#") == std::string::npos) { boost::split(*action, line, boost::is_any_of(" \t"), boost::token_compress_on); @@ -70,22 +56,6 @@ bool ReplayReader::get(ReplayAction* action) } } -void replay_init() -{ - if (!is_replay_active) { - is_replay_active = true; - } -} - -void replay_exit() -{ -} - -bool replay_is_active() -{ - return is_replay_active; -} - static ReplayAction* get_action(char* name) { ReplayAction* action; @@ -192,7 +162,7 @@ int replay_runner(int argc, char* argv[]) if (evt->at(0).compare(argv[0]) == 0) { simgrid::xbt::handle_action(evt); } else { - XBT_WARN("%s:%d: Ignore trace element not for me", reader->filename_, reader->linenum); + XBT_WARN("Ignore trace element ... not for me"); } evt->clear(); } @@ -218,7 +188,5 @@ int replay_runner(int argc, char* argv[]) */ void xbt_replay_action_register(const char* action_name, action_fun function) { - if (!is_replay_active) // If the user registers a function before the start - simgrid::xbt::replay_init(); simgrid::xbt::action_funs.insert({std::string(action_name), function}); }