print ('{')
print (' // Your code handling the simcall')
print ('}')
-# return False
+ return False
else:
if self.name in self.simcalls_pre:
print (
def header(name):
fd = open(name, 'w')
- fd.write(
- '/**********************************************************************/\n')
- fd.write(
- '/* File generated by src/simix/simcalls.py from src/simix/simcalls.in */\n')
- fd.write(
- '/* */\n')
- fd.write(
- '/* DO NOT EVER CHANGE THIS FILE */\n')
- fd.write(
- '/* */\n')
- fd.write(
- '/* change simcalls specification in src/simix/simcalls.in */\n')
- fd.write(
- '/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved. */\n')
- fd.write(
- '/**********************************************************************/\n\n')
+ fd.write('/**********************************************************************/\n')
+ fd.write('/* File generated by src/simix/simcalls.py from src/simix/simcalls.in */\n')
+ fd.write('/* */\n')
+ fd.write('/* DO NOT EVER CHANGE THIS FILE */\n')
+ fd.write('/* */\n')
+ fd.write('/* change simcalls specification in src/simix/simcalls.in */\n')
+ fd.write('/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved. */\n')
+ fd.write('/**********************************************************************/\n\n')
fd.write('/*\n')
- fd.write(
- ' * Note that the name comes from http://en.wikipedia.org/wiki/Popping\n')
- fd.write(
- ' * Indeed, the control flow is doing a strange dance in there.\n')
+ fd.write(' * Note that the name comes from http://en.wikipedia.org/wiki/Popping\n')
+ fd.write(' * Indeed, the control flow is doing a strange dance in there.\n')
fd.write(' *\n')
- fd.write(
- ' * That\'s not about http://en.wikipedia.org/wiki/Poop, despite the odor :)\n')
+ fd.write(' * That\'s not about http://en.wikipedia.org/wiki/Poop, despite the odor :)\n')
fd.write(' */\n\n')
return fd
fd.write('#include "src/mc/mc_forward.hpp"\n')
fd.write('#endif\n')
fd.write('#include "src/kernel/activity/ConditionVariableImpl.hpp"\n')
- fd.write('#include "src/mc/checker/SimcallInspector.hpp"\n')
+ fd.write('#include "src/kernel/actor/SimcallObserver.hpp"\n')
fd.write('\n')
fd.write('XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);\n\n')
fd.write('using simgrid::simix::Simcall;')
fd.write('\n')
- fd.write(
- '/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
+ fd.write('/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
fd.write('constexpr std::array<const char*, simgrid::simix::NUM_SIMCALLS> simcall_names{{\n')
fd.write(' "Simcall::NONE",\n')
fd.write('}};\n\n')
fd.write('/** @private\n')
- fd.write(
- ' * @brief (in kernel mode) unpack the simcall and activate the handler\n')
+ fd.write(' * @brief (in kernel mode) unpack the simcall and activate the handler\n')
fd.write(' *\n')
fd.write(' * This function is generated from src/simix/simcalls.in\n')
fd.write(' */\n')
- fd.write(
- 'void simgrid::kernel::actor::ActorImpl::simcall_handle(int value) {\n')
- fd.write(
- ' XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_.call_));\n')
- fd.write(' SIMCALL_SET_MC_VALUE(simcall_, value);\n')
- fd.write(' if (simcall_.inspector_ != nullptr)\n')
- fd.write(' simcall_.inspector_->is_pending(value);\n')
+ fd.write('void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered)\n')
+ fd.write('{\n')
+ fd.write(' XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_.call_));\n')
+ fd.write(' simcall_.mc_value_ = times_considered;\n')
+ fd.write(' if (simcall_.observer_ != nullptr)\n')
+ fd.write(' simcall_.observer_->prepare(times_considered);\n')
fd.write(' if (context_->wannadie())\n')
fd.write(' return;\n')