+ s4u::Engine::on_platform_created.connect(on_platform_created);
+ s4u::Host::on_creation.connect(on_host_creation);
+ s4u::Host::on_speed_change.connect(on_host_speed_change);
+ s4u::Link::on_creation.connect(on_link_creation);
+ s4u::Link::on_bandwidth_change.connect(on_link_bandwidth_change);
+ s4u::NetZone::on_seal.connect([](s4u::NetZone const& /*netzone*/) { currentContainer.pop_back(); });
+ kernel::routing::NetPoint::on_creation.connect(on_netpoint_creation);
+ }
+ s4u::NetZone::on_creation.connect(on_netzone_creation);
+ s4u::Engine::on_time_advance.connect([](double time_delta) { TRACE_paje_dump_buffer(false); });
+
+ kernel::resource::CpuAction::on_state_change.connect(on_action_state_change);
+ s4u::Link::on_communication_state_change.connect(on_action_state_change);
+
+ if (TRACE_actor_is_enabled()) {
+ s4u::Actor::on_creation.connect(on_actor_creation);
+ s4u::Actor::on_destruction.connect([](s4u::Actor const& actor) {
+ auto container = Container::by_name_or_null(instr_pid(actor));
+ if (container != nullptr)
+ container->remove_from_parent();
+ });
+ s4u::Actor::on_suspend.connect([](s4u::Actor const& actor) {
+ Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("suspend");
+ });
+ s4u::Actor::on_resume.connect(
+ [](s4u::Actor const& actor) { Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event(); });
+ s4u::Actor::on_sleep.connect([](s4u::Actor const& actor) {
+ Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("sleep");
+ });
+ s4u::Actor::on_wake_up.connect(
+ [](s4u::Actor const& actor) { Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event(); });
+ s4u::Exec::on_start.connect([](simgrid::s4u::Actor const& actor, s4u::Exec const&) {
+ Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("execute");
+ });
+ s4u::Exec::on_completion.connect([](s4u::Actor const& actor, s4u::Exec const&) {
+ Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event();
+ });
+ s4u::Comm::on_sender_start.connect([](s4u::Actor const& actor) {
+ Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("send");
+ });
+ s4u::Comm::on_receiver_start.connect([](s4u::Actor const& actor) {
+ Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("receive");
+ });
+ s4u::Comm::on_completion.connect(
+ [](s4u::Actor const& actor) { Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event(); });
+ s4u::Actor::on_host_change.connect(on_actor_host_change);
+ }
+
+ if (TRACE_vm_is_enabled()) {
+ s4u::Host::on_creation.connect(on_vm_creation);
+ s4u::VirtualMachine::on_start.connect([](s4u::VirtualMachine const& vm) {
+ Container::by_name(vm.get_name())->get_state("VM_STATE")->push_event("start");
+ });
+ s4u::VirtualMachine::on_started.connect(
+ [](s4u::VirtualMachine const& vm) { Container::by_name(vm.get_name())->get_state("VM_STATE")->pop_event(); });
+ s4u::VirtualMachine::on_suspend.connect([](s4u::VirtualMachine const& vm) {
+ Container::by_name(vm.get_name())->get_state("VM_STATE")->push_event("suspend");
+ });
+ s4u::VirtualMachine::on_resume.connect(
+ [](s4u::VirtualMachine const& vm) { Container::by_name(vm.get_name())->get_state("VM_STATE")->pop_event(); });
+ s4u::Host::on_destruction.connect(
+ [](s4u::Host const& host) { Container::by_name(host.get_name())->remove_from_parent(); });