1 /* Copyright (c) 2019. 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 #ifndef SIMGRID_MC_SIMCALL_INSPECTOR_HPP
7 #define SIMGRID_MC_SIMCALL_INSPECTOR_HPP
14 class SimcallInspector {
16 /** whether this transition can currently be taken without blocking.
18 * For example, a mutex_lock is not enabled when the mutex is not free.
19 * A comm_receive is not enabled before the corresponding send has been issued.
21 virtual bool is_enabled() { return true; }
23 /** Execute the simcall, from the kernel POV.
25 * Most of the time, this action is in charge of doing what the perf models would have done if not in MC mode.
26 * For example, if it's a random(), choose the value to explore next. If it's a waitany, choose the terminated
27 * communication to consider now.
29 virtual void fire() = 0;
31 /** Some simcalls may only be observable under some circomstances.
32 * Most simcalls are not visible from the MC because they don't have an inspector at all. */
33 virtual bool is_visible() { return true; }
34 virtual std::string to_string() = 0;
35 virtual std::string dot_label() = 0;
38 } // namespace simgrid