-/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */
/* 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 <sstream>
#include <string>
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
/** An element in the recorded path
*
public:
/* Ordering is important here. depends() implementations only consider subsequent types in this ordering */
- XBT_DECLARE_ENUM_CLASS(Type, RANDOM, /* First because indep with anybody */
- TESTANY, WAITANY, /* high priority because they can rewrite themselves to *_WAIT */
- COMM_RECV, COMM_SEND, COMM_TEST, COMM_WAIT, /* Alphabetical ordering of COMM_* */
- MUTEX_LOCK, MUTEX_TEST, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_WAIT, /* alphabetical */
- SEM_LOCK, SEM_UNLOCK, SEM_WAIT, /* alphabetical ordering of SEM transitions */
- /* UNKNOWN must be last */ UNKNOWN);
+ XBT_DECLARE_ENUM_CLASS(Type,
+ /* First because indep with anybody including themselves */
+ RANDOM, ACTOR_JOIN, ACTOR_SLEEP,
+ /* high priority because indep with almost everybody */
+ OBJECT_ACCESS,
+ /* high priority because they can rewrite themselves to *_WAIT */
+ TESTANY, WAITANY,
+ /* BARRIER transitions sorted alphabetically */
+ BARRIER_ASYNC_LOCK, BARRIER_WAIT,
+ /* Alphabetical ordering of COMM_* */
+ COMM_ASYNC_RECV, COMM_ASYNC_SEND, COMM_TEST, COMM_WAIT,
+ /* alphabetical */
+ MUTEX_ASYNC_LOCK, MUTEX_TEST, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_WAIT,
+ /* alphabetical ordering of SEM transitions */
+ SEM_ASYNC_LOCK, SEM_UNLOCK, SEM_WAIT,
+ /* UNKNOWN must be last */
+ UNKNOWN);
Type type_ = Type::UNKNOWN;
aid_t aid_ = 0;
+ /** The user function call that caused this transition to exist. Format: >>filename:line:function()<< */
+ std::string call_location_ = "";
+
/* Which transition was executed for this simcall
*
* Some simcalls can lead to different transitions:
/** Returns something like >>label = "desc", color = c<< to describe the transition in dot format */
virtual std::string dot_string() const;
+ std::string const& get_call_location() const { return call_location_; }
+
/* Moves the application toward a path that was already explored, but don't change the current transition */
- void replay() const;
+ void replay(RemoteApp& app) const;
virtual bool depends(const Transition* other) const { return true; }
/** Make a new transition from serialized description */
Transition* deserialize_transition(aid_t issuer, int times_considered, std::stringstream& stream);
-} // namespace mc
-} // namespace simgrid
+} // namespace simgrid::mc
#endif