diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-02 11:21:24 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-02 11:21:24 +0200 |
commit | a8c0f367142dcaa08e1d1aa8398207d4f762cef8 (patch) | |
tree | ab178c51603af8d647254a078ddf56e6a05616d6 /src/cgtop/cgtop.c | |
parent | d18ec0491ed7c502080c03fa5fe93c8b6ac3d6ea (diff) | |
parent | efdb02375beb0a940c3320865572913780b4d7de (diff) |
Merge pull request #1116 from poettering/unified-rebased
core: unified cgroup hierarchy support
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r-- | src/cgtop/cgtop.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index ae562ba135..1c94bea31a 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -175,7 +175,7 @@ static int process( if (g->n_tasks > 0) g->n_tasks_valid = true; - } else if (streq(controller, "cpuacct")) { + } else if (streq(controller, "cpuacct") && cg_unified() <= 0) { _cleanup_free_ char *p = NULL, *v = NULL; uint64_t new_usage; nsec_t timestamp; @@ -217,7 +217,10 @@ static int process( } else if (streq(controller, "memory")) { _cleanup_free_ char *p = NULL, *v = NULL; - r = cg_get_path(controller, path, "memory.usage_in_bytes", &p); + if (cg_unified() <= 0) + r = cg_get_path(controller, path, "memory.usage_in_bytes", &p); + else + r = cg_get_path(controller, path, "memory.current", &p); if (r < 0) return r; @@ -234,7 +237,7 @@ static int process( if (g->memory > 0) g->memory_valid = true; - } else if (streq(controller, "blkio")) { + } else if (streq(controller, "blkio") && cg_unified() <= 0) { _cleanup_fclose_ FILE *f = NULL; _cleanup_free_ char *p = NULL; uint64_t wr = 0, rd = 0; |