1 /* Copyright (c) 2019-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 #include "src/kernel/actor/SimcallObserver.hpp"
7 #include "simgrid/s4u/Host.hpp"
8 #include "src/kernel/activity/CommImpl.hpp"
9 #include "src/kernel/activity/MailboxImpl.hpp"
10 #include "src/kernel/actor/ActorImpl.hpp"
11 #include "src/mc/mc_config.hpp"
15 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_observer, mc, "Logging specific to MC simcall observation");
21 void SimcallObserver::serialize(std::stringstream& stream) const
23 stream << (short)mc::Transition::Type::UNKNOWN;
25 bool SimcallObserver::depends(SimcallObserver* other)
29 /* Random is only dependent when issued by the same actor (ie, always independent) */
30 bool RandomSimcall::depends(SimcallObserver* other)
32 return get_issuer() == other->get_issuer();
34 void RandomSimcall::serialize(std::stringstream& stream) const
36 stream << (short)mc::Transition::Type::RANDOM << ' ';
37 stream << min_ << ' ' << max_;
40 void RandomSimcall::prepare(int times_considered)
42 next_value_ = min_ + times_considered;
43 XBT_DEBUG("MC_RANDOM(%d, %d) will return %d after %d times", min_, max_, next_value_, times_considered);
46 int RandomSimcall::get_max_consider()
48 return max_ - min_ + 1;
51 bool ConditionWaitSimcall::is_enabled()
53 static bool warned = false;
55 XBT_INFO("Using condition variables in model-checked code is still experimental. Use at your own risk");
61 bool SemAcquireSimcall::is_enabled()
63 static bool warned = false;
65 XBT_INFO("Using semaphore in model-checked code is still experimental. Use at your own risk");
73 } // namespace simgrid