X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/90b0fa923c841996f89a17c252a443a65493fbfc..492c467dc0dadb58aba6e9bb10df6e0c78b2765f:/src/mc/transition/Transition.hpp diff --git a/src/mc/transition/Transition.hpp b/src/mc/transition/Transition.hpp index e8b87274a8..7779f6ec3d 100644 --- a/src/mc/transition/Transition.hpp +++ b/src/mc/transition/Transition.hpp @@ -1,4 +1,4 @@ -/* 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. */ @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** An element in the recorded path * @@ -29,15 +28,24 @@ class Transition { static unsigned long replayed_transitions_; friend State; // FIXME remove this once we have a proper class to handle the statistics - public: /* Ordering is important here. depends() implementations only consider subsequent types in this ordering */ - XBT_DECLARE_ENUM_CLASS(Type, RANDOM, TESTANY, WAITANY, COMM_RECV, COMM_SEND, COMM_TEST, COMM_WAIT, + XBT_DECLARE_ENUM_CLASS(Type, RANDOM, ACTOR_JOIN, /* First because indep with anybody including themselves */ + OBJECT_ACCESS, /* high priority because indep with almost everybody */ + TESTANY, WAITANY, /* high priority because they can rewrite themselves to *_WAIT */ + BARRIER_ASYNC_LOCK, BARRIER_WAIT, /* BARRIER transitions sorted alphabetically */ + COMM_ASYNC_RECV, COMM_ASYNC_SEND, COMM_TEST, COMM_WAIT, /* Alphabetical ordering of COMM_* */ + MUTEX_ASYNC_LOCK, MUTEX_TEST, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_WAIT, /* alphabetical */ + SEM_ASYNC_LOCK, SEM_UNLOCK, SEM_WAIT, /* alphabetical ordering of SEM transitions */ /* UNKNOWN must be last */ UNKNOWN); Type type_ = Type::UNKNOWN; aid_t aid_ = 0; + /** The user function call that caused this transition to exist. + * Format is filename::function::line */ + std::string user_fun_call_ = ""; + /* Which transition was executed for this simcall * * Some simcalls can lead to different transitions: @@ -55,11 +63,13 @@ public: } virtual ~Transition(); + /** Returns a textual representation of the transition. Pointer adresses are omitted if verbose=false */ virtual std::string to_string(bool verbose = false) const; - virtual std::string dot_label() const; + /** Returns something like >>label = "desc", color = c<< to describe the transition in dot format */ + virtual std::string dot_string() const; /* 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; } @@ -72,7 +82,6 @@ public: /** 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