1 /* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 /** \file mc_record.hpp
8 * This file contains the MC replay/record functionality.
9 * The recorded path is written in the log output and can be replayed with MC disabled
10 * (even with a non-MC build) using `--cfg=model-check/replay:$replayPath`.
12 * The same version of Simgrid should be used and the same arguments should be
13 * passed to the application (without the MC specific arguments).
16 #ifndef SIMGRID_MC_RECORD_HPP
17 #define SIMGRID_MC_RECORD_HPP
19 #include "src/mc/mc_forward.hpp"
25 namespace simgrid::mc {
28 std::vector<Transition*> transitions_;
31 RecordTrace() = default;
33 /** Build a trace that can be replayed from a string representation */
34 explicit RecordTrace(const char* data);
35 /** Make a string representation that can later be used to create a new trace */
36 std::string to_string() const;
38 void push_back(Transition* t) { transitions_.push_back(t); }
40 /** Replay all transitions of a trace */
43 /** Parse and replay a string representation */
44 static void replay(const std::string& trace);
47 } // namespace simgrid::mc