From 1d84ae050cb1eb6bfbcd17a10de4e5804fdd4722 Mon Sep 17 00:00:00 2001 From: Charles Duffy Date: Tue, 2 Jun 2015 17:38:49 -0500 Subject: [PATCH] cgtop: IO readings are valid if any data is available, even if unchanged since last tick Emit "0" rather than "-" if no change in IO values are seen for a process since last tick, so long as accounting has registered content at all. --- src/cgtop/cgtop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 3a2842dac69..d630e358828 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -281,11 +281,10 @@ static int process(const char *controller, const char *path, Hashmap *a, Hashmap yr = rd - g->io_input; yw = wr - g->io_output; - if (yr > 0 || yw > 0) { + if (g->io_input > 0 || g->io_output > 0) { g->io_input_bps = (yr * 1000000000ULL) / x; g->io_output_bps = (yw * 1000000000ULL) / x; g->io_valid = true; - } }