Skip to content
Snippets Groups Projects
Commit a3418f70 authored by Florian Fischer's avatar Florian Fischer
Browse files

print blocked context FromAnywhere stats when STATS_BLOCKED_CONTEXT is set

This is analogue to what we do in emper/stats/worker.cpp since 46302a0f.
parent 6ba5b197
No related branches found
No related tags found
No related merge requests found
Pipeline #78119 passed
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "Emper.hpp"
using namespace emper::stats; using namespace emper::stats;
FromAnywhere::FromAnywhere(workerid_t workerCount) FromAnywhere::FromAnywhere(workerid_t workerCount)
...@@ -24,22 +26,26 @@ void FromAnywhere::recordUnblockedContext(workeraffinity_t workerAffinity, ...@@ -24,22 +26,26 @@ void FromAnywhere::recordUnblockedContext(workeraffinity_t workerAffinity,
} }
auto FromAnywhere::operator+=(const FromAnywhere& other) -> FromAnywhere& { auto FromAnywhere::operator+=(const FromAnywhere& other) -> FromAnywhere& {
for (decltype(unblockAffinitiesGeneric)::size_type i = 0; i < unblockAffinitiesGeneric.size(); if constexpr (emper::STATS_BLOCKED_CONTEXT) {
i++) { for (decltype(unblockAffinitiesGeneric)::size_type i = 0; i < unblockAffinitiesGeneric.size();
unblockAffinitiesGeneric[i] += other.unblockAffinitiesGeneric[i]; i++) {
unblockAffinitiesIo[i] += other.unblockAffinitiesIo[i]; unblockAffinitiesGeneric[i] += other.unblockAffinitiesGeneric[i];
unblockAffinitiesIo[i] += other.unblockAffinitiesIo[i];
}
} }
return *this; return *this;
} }
void FromAnywhere::print(std::ostream& out) { void FromAnywhere::print(std::ostream& out) {
for (decltype(unblockAffinitiesGeneric)::size_type i = 0; i < unblockAffinitiesGeneric.size(); if constexpr (emper::STATS_BLOCKED_CONTEXT) {
++i) { for (decltype(unblockAffinitiesGeneric)::size_type i = 0; i < unblockAffinitiesGeneric.size();
out << "unblock-affinities-fa-generic" << std::to_string(i) << ": " ++i) {
<< std::to_string(unblockAffinitiesGeneric[i]) << std::endl; out << "unblock-affinities-fa-generic" << std::to_string(i) << ": "
} << std::to_string(unblockAffinitiesGeneric[i]) << std::endl;
for (decltype(unblockAffinitiesIo)::size_type i = 0; i < unblockAffinitiesIo.size(); ++i) { }
out << "unblock-affinities-fa-io" << std::to_string(i) << ": " for (decltype(unblockAffinitiesIo)::size_type i = 0; i < unblockAffinitiesIo.size(); ++i) {
<< std::to_string(unblockAffinitiesIo[i]) << std::endl; out << "unblock-affinities-fa-io" << std::to_string(i) << ": "
<< std::to_string(unblockAffinitiesIo[i]) << std::endl;
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment