1 /* Copyright (c) 2019-2021. 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/mc/checker/SimcallInspector.hpp"
7 #include "simgrid/s4u/Host.hpp"
8 #include "src/kernel/actor/ActorImpl.hpp"
10 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_inspector, mc, "Logging specific to MC simcall inspection");
15 std::string SimcallInspector::to_string(int /*time_considered*/) const
17 return simgrid::xbt::string_printf("[(%ld)%s (%s)] ", issuer_->get_pid(), issuer_->get_host()->get_cname(),
18 issuer_->get_cname());
21 std::string SimcallInspector::dot_label() const
23 if (issuer_->get_host())
24 return xbt::string_printf("[(%ld)%s] ", issuer_->get_pid(), issuer_->get_cname());
25 return xbt::string_printf("[(%ld)] ", issuer_->get_pid());
28 std::string RandomSimcall::to_string(int time_considered) const
30 return SimcallInspector::to_string(time_considered) + "MC_RANDOM(" + std::to_string(time_considered) + ")";
33 std::string RandomSimcall::dot_label() const
35 return SimcallInspector::dot_label() + "MC_RANDOM(" + std::to_string(next_value_) + ")";
38 void RandomSimcall::prepare(int times_considered)
40 next_value_ = min_ + times_considered;
41 XBT_DEBUG("MC_RANDOM(%d, %d) will return %d after %d times", min_, max_, next_value_, times_considered);
44 int RandomSimcall::get_max_consider() const
46 return max_ - min_ + 1;
49 int RandomSimcall::get_value() const
55 } // namespace simgrid