Loading libprocessgroup/profiles/task_profiles.json +0 −27 Original line number Diff line number Diff line Loading @@ -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": [ Loading libprocessgroup/task_profiles.cpp +0 −29 Original line number Diff line number Diff line Loading @@ -188,18 +188,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__) Loading Loading @@ -958,23 +946,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(); Loading libprocessgroup/task_profiles.h +0 −13 Original line number Diff line number Diff line Loading @@ -91,19 +91,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) {} Loading Loading
libprocessgroup/profiles/task_profiles.json +0 −27 Original line number Diff line number Diff line Loading @@ -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": [ Loading
libprocessgroup/task_profiles.cpp +0 −29 Original line number Diff line number Diff line Loading @@ -188,18 +188,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__) Loading Loading @@ -958,23 +946,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(); Loading
libprocessgroup/task_profiles.h +0 −13 Original line number Diff line number Diff line Loading @@ -91,19 +91,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) {} Loading