From: Charles Duffy Date: Tue, 2 Jun 2015 22:38:49 +0000 (-0500) Subject: cgtop: IO readings are valid if any data is available, even if unchanged since last... X-Git-Tag: v221~122^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d84ae050cb1eb6bfbcd17a10de4e5804fdd4722;p=thirdparty%2Fsystemd.git 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. --- 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; - } }