*
* @details This represents a position in the network. One can send information between two netpoints
*/
-class NetPoint : public simgrid::xbt::Extendable<NetPoint> {
+class NetPoint : public xbt::Extendable<NetPoint> {
public:
enum class Type { Host, Router, NetZone };
bool is_host() const { return component_type_ == Type::Host; }
bool is_router() const { return component_type_ == Type::Router; }
- static simgrid::xbt::signal<void(NetPoint&)> on_creation;
+ static xbt::signal<void(NetPoint&)> on_creation;
bool operator<(const NetPoint& rhs) const { return name_ < rhs.name_; }
XBT_PUBLIC Checker* createLivenessChecker(Session& session);
XBT_PUBLIC Checker* createSafetyChecker(Session& session);
XBT_PUBLIC Checker* createCommunicationDeterminismChecker(Session& session);
-}
-}
+
+} // namespace mc
+} // namespace simgrid
#endif
void prepare();
void real_run();
void log_state() override;
- void deterministic_comm_pattern(int process, const simgrid::mc::PatternCommunication* comm, int backtracking);
+ void deterministic_comm_pattern(int process, const PatternCommunication* comm, int backtracking);
void restoreState();
public:
// These are used by functions which should be moved in CommunicationDeterminismChecker:
void get_comm_pattern(smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
- void complete_comm_pattern(simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr, unsigned int issuer,
- int backtracking);
+ void complete_comm_pattern(RemotePtr<kernel::activity::CommImpl> comm_addr, unsigned int issuer, int backtracking);
private:
/** Stack representing the position in the exploration graph */
- std::list<std::unique_ptr<simgrid::mc::State>> stack_;
- simgrid::mc::VisitedStates visited_states_;
+ std::list<std::unique_ptr<State>> stack_;
+ VisitedStates visited_states_;
unsigned long expanded_states_count_ = 0;
bool initial_communications_pattern_done = false;
char *send_diff = nullptr;
char *recv_diff = nullptr;
};
+} // namespace mc
+} // namespace simgrid
#endif
-}
-}
public:
int num = 0;
bool search_cycle = false;
- std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
+ std::shared_ptr<State> graph_state = nullptr; /* System state included */
xbt_automaton_state_t automaton_state = nullptr;
std::shared_ptr<const std::vector<int>> atomic_propositions;
int requests = 0;
public:
int num;
int other_num = 0; /* Dot output for */
- std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
+ std::shared_ptr<State> graph_state = nullptr; /* System state included */
xbt_automaton_state_t automaton_state;
std::shared_ptr<const std::vector<int>> atomic_propositions;
std::size_t heap_bytes_used = 0;
int actors_count = 0;
- VisitedPair(
- int pair_num, xbt_automaton_state_t automaton_state,
- std::shared_ptr<const std::vector<int>> atomic_propositions,
- std::shared_ptr<simgrid::mc::State> graph_state);
+ VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
+ std::shared_ptr<const std::vector<int>> atomic_propositions, std::shared_ptr<State> graph_state);
~VisitedPair() = default;
};
private:
std::shared_ptr<const std::vector<int>> get_proposition_values();
- std::shared_ptr<VisitedPair> insert_acceptance_pair(simgrid::mc::Pair* pair);
- int insert_visited_pair(std::shared_ptr<VisitedPair> visited_pair, simgrid::mc::Pair* pair);
+ std::shared_ptr<VisitedPair> insert_acceptance_pair(Pair* pair);
+ int insert_visited_pair(std::shared_ptr<VisitedPair> visited_pair, Pair* pair);
void show_acceptance_cycle(std::size_t depth);
void replay();
void remove_acceptance_pair(int pair_num);
std::string previous_request_;
};
-}
-}
+} // namespace mc
+} // namespace simgrid
#endif
namespace mc {
class XBT_PRIVATE SafetyChecker : public Checker {
- simgrid::mc::ReductionMode reductionMode_ = simgrid::mc::ReductionMode::unset;
+ ReductionMode reductionMode_ = ReductionMode::unset;
+
public:
explicit SafetyChecker(Session& session);
~SafetyChecker() = default;
void restore_state();
/** Stack representing the position in the exploration graph */
- std::list<std::unique_ptr<simgrid::mc::State>> stack_;
- simgrid::mc::VisitedStates visited_states_;
- std::unique_ptr<simgrid::mc::VisitedState> visited_state_;
+ std::list<std::unique_ptr<State>> stack_;
+ VisitedStates visited_states_;
+ std::unique_ptr<VisitedState> visited_state_;
unsigned long expanded_states_count_ = 0;
};
-}
-}
+} // namespace mc
+} // namespace simgrid
#endif
*/
struct ExpressionContext {
/** CPU state (registers) */
- unw_cursor_t* cursor = nullptr;
- void* frame_base = nullptr;
- const simgrid::mc::AddressSpace* address_space = nullptr; /** Address space used to read memory */
- simgrid::mc::ObjectInformation* object_info = nullptr;
+ unw_cursor_t* cursor = nullptr;
+ void* frame_base = nullptr;
+ const mc::AddressSpace* address_space = nullptr; /** Address space used to read memory */
+ mc::ObjectInformation* object_info = nullptr;
};
/** When an error happens in the execution of a DWARF expression */
int get_socket() const { return socket_; }
};
-}
-}
+} // namespace mc
+} // namespace simgrid
#endif
static Client* initialize();
static Client* get() { return instance_.get(); }
};
-}
-}
+} // namespace mc
+} // namespace simgrid
#endif
class ActorInformation {
public:
/** MCed address of the process */
- RemotePtr<simgrid::kernel::actor::ActorImpl> address{nullptr};
- Remote<simgrid::kernel::actor::ActorImpl> copy;
+ RemotePtr<kernel::actor::ActorImpl> address{nullptr};
+ Remote<kernel::actor::ActorImpl> copy;
/** Hostname (owned by `mc_modelchecker->hostnames`) */
const char* hostname = nullptr;
void clear_bytes(RemotePtr<void> address, size_t len);
// Debug information:
- std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info(RemotePtr<void> addr) const;
- std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info_exec(RemotePtr<void> addr) const;
- std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info_rw(RemotePtr<void> addr) const;
- simgrid::mc::Frame* find_function(RemotePtr<void> ip) const;
- const simgrid::mc::Variable* find_variable(const char* name) const;
+ std::shared_ptr<ObjectInformation> find_object_info(RemotePtr<void> addr) const;
+ std::shared_ptr<ObjectInformation> find_object_info_exec(RemotePtr<void> addr) const;
+ std::shared_ptr<ObjectInformation> find_object_info_rw(RemotePtr<void> addr) const;
+ Frame* find_function(RemotePtr<void> ip) const;
+ const Variable* find_variable(const char* name) const;
// Heap access:
xbt_mheap_t get_heap()
void ignore_global_variable(const char* name)
{
- for (std::shared_ptr<simgrid::mc::ObjectInformation> const& info : this->object_infos)
+ for (std::shared_ptr<ObjectInformation> const& info : this->object_infos)
info->remove_global_variable(name);
}
void unignore_heap(void* address, size_t size);
void ignore_local_variable(const char* var_name, const char* frame_name);
- std::vector<simgrid::mc::ActorInformation>& actors();
- std::vector<simgrid::mc::ActorInformation>& dead_actors();
+ std::vector<ActorInformation>& actors();
+ std::vector<ActorInformation>& dead_actors();
/** Get a local description of a remote SIMIX actor */
- simgrid::mc::ActorInformation* resolve_actor_info(simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl> actor)
+ ActorInformation* resolve_actor_info(RemotePtr<kernel::actor::ActorImpl> actor)
{
xbt_assert(mc_model_checker != nullptr);
if (not actor)
}
/** Get a local copy of the SIMIX actor structure */
- simgrid::kernel::actor::ActorImpl* resolve_actor(simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl> process)
+ kernel::actor::ActorImpl* resolve_actor(RemotePtr<kernel::actor::ActorImpl> process)
{
- simgrid::mc::ActorInformation* actor_info = this->resolve_actor_info(process);
+ ActorInformation* actor_info = this->resolve_actor_info(process);
if (actor_info)
return actor_info->copy.get_buffer();
else
pid_t pid_ = -1;
Channel channel_;
bool running_ = false;
- std::vector<simgrid::xbt::VmMap> memory_map_;
+ std::vector<xbt::VmMap> memory_map_;
RemotePtr<void> maestro_stack_start_;
RemotePtr<void> maestro_stack_end_;
int memory_file = -1;
public:
// object info
// TODO, make private (first, objectify simgrid::mc::ObjectInformation*)
- std::vector<std::shared_ptr<simgrid::mc::ObjectInformation>> object_infos;
- std::shared_ptr<simgrid::mc::ObjectInformation> libsimgrid_info;
- std::shared_ptr<simgrid::mc::ObjectInformation> binary_info;
+ std::vector<std::shared_ptr<ObjectInformation>> object_infos;
+ std::shared_ptr<ObjectInformation> libsimgrid_info;
+ std::shared_ptr<ObjectInformation> binary_info;
// Copies of MCed SMX data structures
/** Copy of `simix_global->process_list`
/** Open a FD to a remote process memory (`/dev/$pid/mem`)
*/
XBT_PRIVATE int open_vm(pid_t pid, int flags);
-}
-}
+} // namespace mc
+} // namespace simgrid
#endif
{
return RemotePtr<T>(p);
}
-}
-}
+} // namespace mc
+} // namespace simgrid
#endif
private:
void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size);
- void snapshot_regions(simgrid::mc::RemoteClient* process);
- void snapshot_stacks(simgrid::mc::RemoteClient* process);
+ void snapshot_regions(RemoteClient* process);
+ void snapshot_stacks(RemoteClient* process);
};
} // namespace mc
} // namespace simgrid