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
diff --git a/libprocessgroup/profiles/task_profiles.json b/libprocessgroup/profiles/task_profiles.json
index 411c38c..feda3b4 100644
--- a/libprocessgroup/profiles/task_profiles.json
+++ b/libprocessgroup/profiles/task_profiles.json
@@ -572,33 +572,6 @@
},
{
- "Name": "PerfBoost",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "50%",
- "Clamp": "0"
- }
- }
- ]
- },
- {
- "Name": "PerfClamp",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "0",
- "Clamp": "30%"
- }
- }
- ]
- },
-
- {
"Name": "LowMemoryUsage",
"Actions": [
{
diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp
index 7f33d4a..ff03355 100644
--- a/libprocessgroup/task_profiles.cpp
+++ b/libprocessgroup/task_profiles.cpp
@@ -183,18 +183,6 @@
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 @@
} 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();
diff --git a/libprocessgroup/task_profiles.h b/libprocessgroup/task_profiles.h
index e52ce38..782b3ff 100644
--- a/libprocessgroup/task_profiles.h
+++ b/libprocessgroup/task_profiles.h
@@ -90,19 +90,6 @@
};
// 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) {}