libprocessgroup: Remove SetClamps action

The SetClamps profile action has always been a no-op. Remove the class
and parsing code for this action.

Bug: 372915523
Change-Id: Ic6e685aa992b83464dfb5e6446b622a57ed61db5
This commit is contained in:
T.J. Mercier 2024-10-10 21:34:45 +00:00
parent 7e0ba3af9a
commit 2a030efe67
3 changed files with 0 additions and 69 deletions

View file

@ -571,33 +571,6 @@
]
},
{
"Name": "PerfBoost",
"Actions": [
{
"Name": "SetClamps",
"Params":
{
"Boost": "50%",
"Clamp": "0"
}
}
]
},
{
"Name": "PerfClamp",
"Actions": [
{
"Name": "SetClamps",
"Params":
{
"Boost": "0",
"Clamp": "30%"
}
}
]
},
{
"Name": "LowMemoryUsage",
"Actions": [

View file

@ -183,18 +183,6 @@ bool ProfileAttribute::GetPathForUID(uid_t uid, std::string* path) const {
return true;
}
bool SetClampsAction::ExecuteForProcess(uid_t, pid_t) const {
// TODO: add support when kernel supports util_clamp
LOG(WARNING) << "SetClampsAction::ExecuteForProcess is not supported";
return false;
}
bool SetClampsAction::ExecuteForTask(int) const {
// TODO: add support when kernel supports util_clamp
LOG(WARNING) << "SetClampsAction::ExecuteForTask is not supported";
return false;
}
// To avoid issues in sdk_mac build
#if defined(__ANDROID__)
@ -902,23 +890,6 @@ bool TaskProfiles::Load(const CgroupMap& cg_map, const std::string& file_name) {
} else {
LOG(WARNING) << "SetAttribute: unknown attribute: " << attr_name;
}
} else if (action_name == "SetClamps") {
std::string boost_value = params_val["Boost"].asString();
std::string clamp_value = params_val["Clamp"].asString();
char* end;
unsigned long boost;
boost = strtoul(boost_value.c_str(), &end, 10);
if (end > boost_value.c_str()) {
unsigned long clamp = strtoul(clamp_value.c_str(), &end, 10);
if (end > clamp_value.c_str()) {
profile->Add(std::make_unique<SetClampsAction>(boost, clamp));
} else {
LOG(WARNING) << "SetClamps: invalid parameter " << clamp_value;
}
} else {
LOG(WARNING) << "SetClamps: invalid parameter: " << boost_value;
}
} else if (action_name == "WriteFile") {
std::string attr_filepath = params_val["FilePath"].asString();
std::string attr_procfilepath = params_val["ProcFilePath"].asString();

View file

@ -90,19 +90,6 @@ class ProfileAction {
};
// Profile actions
class SetClampsAction : public ProfileAction {
public:
SetClampsAction(int boost, int clamp) noexcept : boost_(boost), clamp_(clamp) {}
const char* Name() const override { return "SetClamps"; }
bool ExecuteForProcess(uid_t uid, pid_t pid) const override;
bool ExecuteForTask(pid_t tid) const override;
protected:
int boost_;
int clamp_;
};
class SetTimerSlackAction : public ProfileAction {
public:
SetTimerSlackAction(unsigned long slack) noexcept : slack_(slack) {}