diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-02-23 16:23:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 16:23:02 +0100 |
commit | ecc0eab247da25a6767ccabd2162a4d03de6ee8c (patch) | |
tree | 4041d203a3611df9705b23a76611f55de019fea3 /src/cgtop/cgtop.c | |
parent | c07afaa5e51d079691c74230377ce6fcc97228e5 (diff) | |
parent | 0a05dcc09dd723dcf017bf42432d33e58ec56a1d (diff) |
Merge pull request #4670 from htejun/systemd-controller-on-unified-v2
Systemd controller on unified v2
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r-- | src/cgtop/cgtop.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 50ac6a58b0..45c050c9c3 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -214,7 +214,7 @@ static int process( uint64_t new_usage; nsec_t timestamp; - if (cg_all_unified() > 0) { + if (cg_all_unified()) { const char *keys[] = { "usage_usec", NULL }; _cleanup_free_ char *val = NULL; @@ -274,7 +274,7 @@ static int process( } else if (streq(controller, "memory")) { _cleanup_free_ char *p = NULL, *v = NULL; - if (cg_all_unified() <= 0) + if (!cg_all_unified()) r = cg_get_path(controller, path, "memory.usage_in_bytes", &p); else r = cg_get_path(controller, path, "memory.current", &p); @@ -294,15 +294,14 @@ static int process( if (g->memory > 0) g->memory_valid = true; - } else if ((streq(controller, "io") && cg_all_unified() > 0) || - (streq(controller, "blkio") && cg_all_unified() <= 0)) { + } else if ((streq(controller, "io") && cg_all_unified()) || + (streq(controller, "blkio") && !cg_all_unified())) { _cleanup_fclose_ FILE *f = NULL; _cleanup_free_ char *p = NULL; - bool unified = cg_all_unified() > 0; uint64_t wr = 0, rd = 0; nsec_t timestamp; - r = cg_get_path(controller, path, unified ? "io.stat" : "blkio.io_service_bytes", &p); + r = cg_get_path(controller, path, cg_all_unified() ? "io.stat" : "blkio.io_service_bytes", &p); if (r < 0) return r; @@ -325,7 +324,7 @@ static int process( l += strcspn(l, WHITESPACE); l += strspn(l, WHITESPACE); - if (unified) { + if (cg_all_unified()) { while (!isempty(l)) { if (sscanf(l, "rbytes=%" SCNu64, &k)) rd += k; |