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

Commit 4d0d2859 authored by T.J. Mercier's avatar T.J. Mercier
Browse files

libprocessgroup: Convert incorrect PLOGs to LOGs

PLOG depends on errno being set to a useful value, otherwise it will
print a meaningless error string. A few PLOG call sites occur where
either errno is not set at all, or it is set only some of the time where
there are already PLOG calls closer to where the error occurs. Convert
these PLOG calls to LOG.

Bug: 301871933
Change-Id: Ifa6bd2401f9dd9b84b2506e886336e89bac81bb1
parent a99e7d84
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ bool CgroupGetAttributePathForTask(const std::string& attr_name, int tid, std::s
    }

    if (!attr->GetPathForTask(tid, path)) {
        PLOG(ERROR) << "Failed to find cgroup for tid " << tid;
        LOG(ERROR) << "Failed to find cgroup for tid " << tid;
        return false;
    }

@@ -601,7 +601,7 @@ int createProcessGroup(uid_t uid, int initialPid, bool memControl) {
    CHECK_GT(initialPid, 0);

    if (memControl && !UsePerAppMemcg()) {
        PLOG(ERROR) << "service memory controls are used without per-process memory cgroup support";
        LOG(ERROR) << "service memory controls are used without per-process memory cgroup support";
        return -EINVAL;
    }

@@ -623,13 +623,13 @@ int createProcessGroup(uid_t uid, int initialPid, bool memControl) {

static bool SetProcessGroupValue(int tid, const std::string& attr_name, int64_t value) {
    if (!isMemoryCgroupSupported()) {
        PLOG(ERROR) << "Memcg is not mounted.";
        LOG(ERROR) << "Memcg is not mounted.";
        return false;
    }

    std::string path;
    if (!CgroupGetAttributePathForTask(attr_name, tid, &path)) {
        PLOG(ERROR) << "Failed to find attribute '" << attr_name << "'";
        LOG(ERROR) << "Failed to find attribute '" << attr_name << "'";
        return false;
    }