Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
unsecure commit
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 18 May 2018 12:11:02 +0000 (14:11 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 18 May 2018 12:11:02 +0000 (14:11 +0200)
src/instr/instr_platform.cpp
src/msg/instr_msg_process.cpp [deleted file]
src/msg/msg_private.hpp
src/msg/msg_process.cpp
tools/cmake/DefinePackages.cmake

index fe2f6e8..eeb3877 100644 (file)
@@ -278,6 +278,13 @@ static void instr_on_platform_created()
   TRACE_paje_dump_buffer(true);
 }
 
+static void TRACE_actor_kill(smx_process_exit_status_t status, msg_process_t process)
+{
+  if (status == SMX_EXIT_FAILURE)
+    // kill means that this actor no longer exists, let's destroy it
+    simgrid::instr::Container::by_name(instr_pid(process))->remove_from_parent();
+}
+
 static void instr_actor_on_creation(simgrid::s4u::ActorPtr actor)
 {
   container_t root      = simgrid::instr::Container::get_root();
@@ -294,6 +301,8 @@ static void instr_actor_on_creation(simgrid::s4u::ActorPtr actor)
   state->add_entity_value("task_execute", "0 1 1");
   root->type_->by_name_or_create("ACTOR_LINK", actor_type, actor_type);
   root->type_->by_name_or_create("ACTOR_TASK_LINK", actor_type, actor_type);
+
+  actor->on_exit((int_f_pvoid_pvoid_t)TRACE_actor_kill, actor->get_impl());
 }
 
 static long long int counter = 0;
diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp
deleted file mode 100644 (file)
index a0aa212..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 2010-2018. 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/instr/instr_private.hpp"
-#include "src/msg/msg_private.hpp"
-#include "src/simix/ActorImpl.hpp"
-#include <simgrid/actor.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
-
-std::string instr_pid(msg_process_t proc)
-{
-  return std::string(proc->get_cname()) + "-" + std::to_string(proc->get_pid());
-}
-
-void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process)
-{
-  if (TRACE_actor_is_enabled() && status == SMX_EXIT_FAILURE) {
-    //kill means that this process no longer exists, let's destroy it
-    simgrid::instr::Container::by_name(instr_pid(process))->remove_from_parent();
-  }
-}
index 45ea718..25cead3 100644 (file)
@@ -102,8 +102,6 @@ XBT_PRIVATE void TRACE_msg_task_get_start();
 XBT_PRIVATE void TRACE_msg_task_put_start(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_put_end();
 
-/* declaration of instrumentation functions from msg_process_instr.c */
-XBT_PRIVATE void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process);
 
 inline void s_simdata_task_t::setUsed()
 {
index 581d75c..3d637e4 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
 
+std::string instr_pid(msg_process_t proc)
+{
+  return std::string(proc->get_cname()) + "-" + std::to_string(proc->get_pid());
+}
+
 /** @addtogroup m_process_management
  *
  *  Processes (#msg_process_t) are independent agents that can do stuff on their own. They are in charge of executing
@@ -153,8 +158,7 @@ msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<vo
     delete msgExt;
     return nullptr;
   }
-
-  process->ciface()->on_exit((int_f_pvoid_pvoid_t)TRACE_msg_process_kill, process);
+  MSG_process_yield();
   return process->ciface();
 }
 
@@ -181,7 +185,7 @@ msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host,
       SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->get_cname(), &props, nullptr);
   if (not process)
     xbt_die("Could not attach");
-  process->ciface()->on_exit((int_f_pvoid_pvoid_t)TRACE_msg_process_kill, process);
+  MSG_process_yield();
   return process->ciface();
 }
 
index e50797f..0aa0645 100644 (file)
@@ -439,7 +439,6 @@ set(SIMGRID_SRC
   )
 
 set(MSG_SRC
-  src/msg/instr_msg_process.cpp
   src/msg/instr_msg_task.cpp
   src/msg/msg_global.cpp
   src/msg/msg_gos.cpp