summaryrefslogtreecommitdiffstats
path: root/libprocessgroup
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2017-07-08 00:04:04 +0000
committerTim Murray <timmurray@google.com>2017-07-08 00:04:42 +0000
commitfc10e3d5e5385081853b7d1b3cc41f882ac6325d (patch)
tree2b53434afe8c0775a0f13d75b17544e463939e24 /libprocessgroup
parent32375c23284704a7d044ed79060c4431468b4b4e (diff)
downloadcore-fc10e3d5e5385081853b7d1b3cc41f882ac6325d.tar.gz
core-fc10e3d5e5385081853b7d1b3cc41f882ac6325d.tar.bz2
core-fc10e3d5e5385081853b7d1b3cc41f882ac6325d.zip
Revert "Use mem cgroups in libprocessgroup if they're available"
This reverts commit 32375c23284704a7d044ed79060c4431468b4b4e. bug 63164307 Change-Id: I3336bbf7c2f3297b231c5b0a1ef538faff9513fd
Diffstat (limited to 'libprocessgroup')
-rw-r--r--libprocessgroup/processgroup.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp
index 9b8248e88..f5d4e1c9e 100644
--- a/libprocessgroup/processgroup.cpp
+++ b/libprocessgroup/processgroup.cpp
@@ -43,6 +43,9 @@
using namespace std::chrono_literals;
+// Uncomment line below use memory cgroups for keeping track of (forked) PIDs
+// #define USE_MEMCG 1
+
#define MEM_CGROUP_PATH "/dev/memcg/apps"
#define MEM_CGROUP_TASKS "/dev/memcg/apps/tasks"
#define ACCT_CGROUP_PATH "/acct"
@@ -88,6 +91,7 @@ class ProcessGroup {
};
static const char* getCgroupRootPath() {
+#ifdef USE_MEMCG
static const char* cgroup_root_path = NULL;
std::call_once(init_path_flag, [&]() {
// Check if mem cgroup is mounted, only then check for write-access to avoid
@@ -96,6 +100,9 @@ static const char* getCgroupRootPath() {
ACCT_CGROUP_PATH : MEM_CGROUP_PATH;
});
return cgroup_root_path;
+#else
+ return ACCT_CGROUP_PATH;
+#endif
}
static int convertUidToPath(char *path, size_t size, uid_t uid)