Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b98f349c authored by Marco Ballesio's avatar Marco Ballesio Committed by Automerger Merge Worker
Browse files

Merge "libprocessgroup: new method to get cgroup paths" am: 86f17cce

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1607196

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I486496a68f7cad165fac6ae13da6138600c46702
parents fc700ded 86f17cce
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& pr

static constexpr const char* CGROUPS_RC_PATH = "/dev/cgroup_info/cgroup.rc";
// Path to test against for freezer support
// TODO: remove and replace with a function call, see http://b/180056337
// TODO: remove it once https://r.android.com/1607196 is properly merged to all branches,
// see http://b/180056337
static constexpr const char* CGROUP_FREEZE_PATH = "/sys/fs/cgroup/uid_0/cgroup.freeze";

bool UsePerAppMemcg();
@@ -68,6 +69,10 @@ bool setProcessGroupLimit(uid_t uid, int initialPid, int64_t limitInBytes);

void removeAllProcessGroups(void);

// Provides the path for an attribute in a specific process group
// Returns false in case of error, true in case of success
bool getAttributePathForTask(const std::string& attr_name, int tid, std::string* path);

#endif // __ANDROID_VNDK__

__END_DECLS
+4 −0
Original line number Diff line number Diff line
@@ -508,3 +508,7 @@ bool setProcessGroupSoftLimit(uid_t, int pid, int64_t soft_limit_in_bytes) {
bool setProcessGroupLimit(uid_t, int pid, int64_t limit_in_bytes) {
    return SetProcessGroupValue(pid, "MemLimit", limit_in_bytes);
}

bool getAttributePathForTask(const std::string& attr_name, int tid, std::string* path) {
    return CgroupGetAttributePathForTask(attr_name, tid, path);
}
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
    "Controllers": [
      {
        "Controller": "freezer",
        "Path": "freezer",
        "Path": ".",
        "Mode": "0755",
        "UID": "system",
        "GID": "system"