X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FScheduler%2FFIFORunner.cc;h=ad585203137ad6e2010ca81531d462554425e015;hb=57daeae6f2e924ce3f16f9677c3474f531cba9e5;hp=85e98e3b51c99d192465de2ac875e199de6daced;hpb=93d9568d448749dc187e7622b733a4a3caa319df;p=senf.git diff --git a/senf/Scheduler/FIFORunner.cc b/senf/Scheduler/FIFORunner.cc index 85e98e3..ad58520 100644 --- a/senf/Scheduler/FIFORunner.cc +++ b/senf/Scheduler/FIFORunner.cc @@ -30,15 +30,18 @@ #include #include #include -#include -#include #ifdef SENF_DEBUG #include #endif #include #include #include +#include +#include #include "senf/Utils/IgnoreValue.hh" +#include +#include +#include "ConsoleDir.hh" //#include "FIFORunner.mpp" #define prefix_ @@ -71,12 +74,38 @@ prefix_ senf::scheduler::detail::FIFORunner::FIFORunner() tasks_.push_back(highPriorityEnd_); tasks_.push_back(normalPriorityEnd_); + +#ifndef SENF_DISABLE_CONSOLE + namespace fty = console::factory; + consoleDir().add("abortOnWatchdocTimeout", fty::Command( + SENF_MEMBINDFNP( bool, FIFORunner, abortOnTimeout, () const )) + .doc("Get current watchdog abort on event status.") ); + consoleDir().add("abortOnWatchdocTimeout", fty::Command( + SENF_MEMBINDFNP( void, FIFORunner, abortOnTimeout, (bool) )) + .doc("Enable/disable abort on watchdog event.") ); + consoleDir().add("watchdogTimeout", fty::Command( + SENF_MEMBINDFNP( unsigned, FIFORunner, taskTimeout, () const )) + .doc("Get current watchdog timeout in milliseconds") ); + consoleDir().add("watchdogTimeout", fty::Command( + SENF_MEMBINDFNP( void, FIFORunner, taskTimeout, (unsigned) )) + .doc("Set watchdog timeout to in milliseconds\n" + "Setting the watchdog timeout to 0 will disable the watchdog.") ); + consoleDir().add("watchdogEvents", fty::Command(membind( &FIFORunner::hangCount, this)) + .doc("Get number of occurred watchdog events.\n" + "Calling this method will reset the counter to 0") ); +#endif } prefix_ senf::scheduler::detail::FIFORunner::~FIFORunner() { timer_delete(watchdogId_); signal(SIGURG, SIG_DFL); + +#ifndef SENF_DISABLE_CONSOLE + consoleDir().remove("abortOnWatchdocTimeout"); + consoleDir().remove("watchdogTimeout"); + consoleDir().remove("watchdogEvents"); +#endif } prefix_ void senf::scheduler::detail::FIFORunner::startWatchdog()