-/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-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. */
#include "src/kernel/activity/ExecImpl.hpp"
#include "src/kernel/resource/VirtualMachineImpl.hpp"
-namespace simgrid {
-namespace plugin {
-namespace vm {
+namespace simgrid::plugin::vm {
class DirtyPageTrackingExt {
bool dp_tracking_ = false;
std::map<kernel::activity::ExecImpl const*, double> dp_objs_;
return total;
}
-} // namespace vm
-} // namespace plugin
-} // namespace simgrid
+} // namespace simgrid::plugin::vm
using simgrid::plugin::vm::DirtyPageTrackingExt;
}
}
-static void on_exec_completion(const simgrid::s4u::Activity& e)
+static void on_exec_completion(const simgrid::s4u::Exec& e)
{
- const auto exec = dynamic_cast<simgrid::kernel::activity::ExecImpl*>(e.get_impl());
+ const auto* exec = dynamic_cast<simgrid::kernel::activity::ExecImpl*>(e.get_impl());
if (exec == nullptr)
return;
const simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(exec->get_host());
simgrid::kernel::resource::VirtualMachineImpl::extension_create<DirtyPageTrackingExt>();
simgrid::s4u::VirtualMachine::on_creation_cb(&on_virtual_machine_creation);
simgrid::s4u::Exec::on_start_cb(&on_exec_creation);
- simgrid::s4u::Activity::on_completion_cb(&on_exec_completion);
+ simgrid::s4u::Exec::on_completion_cb(&on_exec_completion);
}
}