Ubuntu doens't have a CPU governor.

This commit is contained in:
Robin Davies
2024-11-11 19:31:43 -05:00
parent bd994031bd
commit 64062fbbd7
17 changed files with 161 additions and 88 deletions
+13
View File
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <ifaddrs.h>
#include "Ipv6Helpers.hpp"
#include "CpuGovernor.hpp"
using namespace pipedal;
@@ -143,6 +144,10 @@ void AdminClient::SetGovernorSettings(const std::string &settings)
{
throw PiPedalException("Can't use AdminClient when running interactively.");
}
if (!HasCpuGovernor())
{
return;
}
std::stringstream cmd;
cmd << "GovernorSettings ";
json_writer writer(cmd, true);
@@ -161,6 +166,10 @@ void AdminClient::MonitorGovernor(const std::string &governor)
{
return;
}
if (!HasCpuGovernor())
{
return;
}
std::stringstream cmd;
cmd << "MonitorGovernor ";
json_writer writer(cmd, true);
@@ -178,6 +187,10 @@ void AdminClient::UnmonitorGovernor()
{
return;
}
if (!HasCpuGovernor())
{
return;
}
std::stringstream cmd;
cmd << "UnmonitorGovernor";
cmd << '\n';