Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move a function to the right file and other cleanups
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 4 Nov 2022 23:50:14 +0000 (00:50 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 4 Nov 2022 23:50:14 +0000 (00:50 +0100)
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/Simcall.cpp
src/kernel/actor/Simcall.hpp
src/simix/libsmx.cpp

index c863647..6def798 100644 (file)
@@ -508,4 +508,22 @@ void create_maestro(const std::function<void()>& code)
   engine->set_maestro(maestro);
 }
 
+/** (in kernel mode) unpack the simcall and activate the handler */
+void ActorImpl::simcall_handle(int times_considered)
+{
+  XBT_DEBUG("Handling simcall %p: %s(%ld) %s", &simcall_, simcall_.issuer_->get_cname(), simcall_.issuer_->get_pid(),
+            (simcall_.observer_ != nullptr ? simcall_.observer_->to_string().c_str() : simcall_.get_cname()));
+  if (simcall_.observer_ != nullptr)
+    simcall_.observer_->prepare(times_considered);
+  if (wannadie())
+    return;
+
+  xbt_assert(simcall_.call_ != Simcall::Type::NONE, "Asked to do the noop syscall on %s@%s", get_cname(),
+             get_host()->get_cname());
+
+  (*simcall_.code_)();
+  if (simcall_.call_ == Simcall::Type::RUN_ANSWERED)
+    simcall_answer();
+}
+
 } // namespace simgrid::kernel::actor
index 9f35a3b..09c7cdf 100644 (file)
 #include "src/kernel/context/Context.hpp"
 #include "xbt/log.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_simcall, kernel, "transmuting from user request into kernel handlers");
-
 namespace simgrid::kernel::actor {
 
-/** @private
- * @brief (in kernel mode) unpack the simcall and activate the handler
- *
- */
-void ActorImpl::simcall_handle(int times_considered)
-{
-  XBT_DEBUG("Handling simcall %p: %s(%ld) %s", &simcall_, simcall_.issuer_->get_cname(), simcall_.issuer_->get_pid(),
-            (simcall_.observer_ != nullptr ? simcall_.observer_->to_string().c_str() : simcall_.get_cname()));
-  if (simcall_.observer_ != nullptr)
-    simcall_.observer_->prepare(times_considered);
-  if (wannadie())
-    return;
-
-  xbt_assert(simcall_.call_ != Simcall::Type::NONE, "Asked to do the noop syscall on %s@%s", get_cname(),
-             get_host()->get_cname());
-
-  (*simcall_.code_)();
-  if (simcall_.call_ == Simcall::Type::RUN_ANSWERED)
-    simcall_answer();
-}
-
 /** @brief returns a printable string representing a simcall */
 const char* Simcall::get_cname() const
 {
index bf7562b..8e7869f 100644 (file)
@@ -10,7 +10,6 @@
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "xbt/utility.hpp"
 
-/********************************* Simcalls *********************************/
 namespace simgrid::kernel::actor {
 
 /**
index 4a2938a..7929e52 100644 (file)
@@ -18,7 +18,7 @@
 #define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v335)
 #include <simgrid/simix.h>
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_simcall);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_simcall, kernel, "transmuting from user request into kernel handlers");
 
 /**
  * @ingroup simix_comm_management