Commit 58015d19 authored by Sebastian Woelke's avatar Sebastian Woelke

Add debug tracking for home execution unit

parent aaa35e0f
...@@ -62,6 +62,10 @@ public: ...@@ -62,6 +62,10 @@ public:
proxies_ = ptr; proxies_ = ptr;
} }
virtual std::string to_string() const {
return "execution unit has no description yet";
}
protected: protected:
actor_system* system_; actor_system* system_;
proxy_registry* proxies_; proxy_registry* proxies_;
......
...@@ -88,6 +88,13 @@ public: ...@@ -88,6 +88,13 @@ public:
/// A reference-counting pointer to a `stream_manager`. /// A reference-counting pointer to a `stream_manager`.
using stream_manager_ptr = intrusive_ptr<stream_manager>; using stream_manager_ptr = intrusive_ptr<stream_manager>;
std::string to_string_home_eu() const {
return home_eu_->to_string();
}
std::string to_string_current_eu() const {
return current_eu_->to_string();
}
/// A container for associating stream IDs to handlers. /// A container for associating stream IDs to handlers.
using streams_map = std::unordered_map<stream_id, stream_manager_ptr>; using streams_map = std::unordered_map<stream_id, stream_manager_ptr>;
...@@ -879,6 +886,7 @@ protected: ...@@ -879,6 +886,7 @@ protected:
/// Stores the home execution unit. /// Stores the home execution unit.
execution_unit* home_eu_; execution_unit* home_eu_;
execution_unit* current_eu_;
/// @endcond /// @endcond
}; };
......
...@@ -90,6 +90,10 @@ public: ...@@ -90,6 +90,10 @@ public:
return id_; return id_;
} }
std::string to_string() const override {
return std::string("id: ") + std::to_string(static_cast<int>(id()));
}
std::thread& get_thread() { std::thread& get_thread() {
return this_thread_; return this_thread_;
} }
......
...@@ -36,6 +36,11 @@ public: ...@@ -36,6 +36,11 @@ public:
/// It is assumed that `this` is never in the neighborhood of `ptr`. /// It is assumed that `this` is never in the neighborhood of `ptr`.
bool is_neighbor(execution_unit* ptr) const override; bool is_neighbor(execution_unit* ptr) const override;
std::string to_string() const override {
return "scoped_execution_unit";
}
}; };
} // namespace caf } // namespace caf
......
...@@ -107,6 +107,7 @@ scheduled_actor::scheduled_actor(actor_config& cfg) ...@@ -107,6 +107,7 @@ scheduled_actor::scheduled_actor(actor_config& cfg)
, exception_handler_(default_exception_handler) , exception_handler_(default_exception_handler)
# endif // CAF_NO_EXCEPTIONS # endif // CAF_NO_EXCEPTIONS
, home_eu_(cfg.host) , home_eu_(cfg.host)
, current_eu_(cfg.host)
{ {
// nop // nop
} }
...@@ -229,6 +230,7 @@ void scheduled_actor::intrusive_ptr_release_impl() { ...@@ -229,6 +230,7 @@ void scheduled_actor::intrusive_ptr_release_impl() {
resumable::resume_result resumable::resume_result
scheduled_actor::resume(execution_unit* ctx, size_t max_throughput) { scheduled_actor::resume(execution_unit* ctx, size_t max_throughput) {
current_eu_ = ctx;
CAF_PUSH_AID(id()); CAF_PUSH_AID(id());
if (!activate(ctx)) if (!activate(ctx))
return resume_result::done; return resume_result::done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment