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

IoSleepStrategies: increment notifications stats in the AbstractIoSleepStrategy

The WaitfdSleepStrategy did not gather the amount of posted notifications
but the PipeSleepStrategy did.
Move the stats accounting into AbstractIoSleepStrategy so all derived
strategies track the amount of written notifications.
parent d13e6147
No related branches found
No related tags found
1 merge request!411add waitfd support, generalize IO sleep_strategy code and use MSG_RING
...@@ -271,6 +271,7 @@ class AbstractIoSleepStrategy : public Logger<LogSubsystem::SLEEP_S> { ...@@ -271,6 +271,7 @@ class AbstractIoSleepStrategy : public Logger<LogSubsystem::SLEEP_S> {
const unsigned toWakeup = getSleeperCountToWakeup<callerEnvironment>(sleeping, count); const unsigned toWakeup = getSleeperCountToWakeup<callerEnvironment>(sleeping, count);
if (toWakeup) { if (toWakeup) {
stats.incNotify(); stats.incNotify();
stats.addNotifications(toWakeup);
if constexpr (callerEnvironment == CallerEnvironment::EMPER) { if constexpr (callerEnvironment == CallerEnvironment::EMPER) {
writeNotificationsFromEmper(hint, toWakeup); writeNotificationsFromEmper(hint, toWakeup);
} else { } else {
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "emper-common.h" #include "emper-common.h"
#include "sleep_strategy/AbstractIoSleepStrategy.hpp" #include "sleep_strategy/AbstractIoSleepStrategy.hpp"
#include "sleep_strategy/AbstractWorkerSleepStrategy.hpp" #include "sleep_strategy/AbstractWorkerSleepStrategy.hpp"
#include "sleep_strategy/Stats.hpp"
class Runtime; class Runtime;
...@@ -47,8 +46,6 @@ class PipeSleepStrategy : public AbstractWorkerSleepStrategy<PipeSleepStrategy>, ...@@ -47,8 +46,6 @@ class PipeSleepStrategy : public AbstractWorkerSleepStrategy<PipeSleepStrategy>,
Pipe global; Pipe global;
void writeNotifications(emper::FiberHint hint, unsigned count) { void writeNotifications(emper::FiberHint hint, unsigned count) {
stats.addNotifications(count);
std::vector<void*> hints(count, hint); std::vector<void*> hints(count, hint);
ssize_t res = write(global.notifyFd, hints.data(), sizeof(void*) * hints.size()); ssize_t res = write(global.notifyFd, hints.data(), sizeof(void*) * hints.size());
......
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