From: Sander Eikelenboom Date: Wed, 19 Feb 2020 20:31:30 +0000 (+0100) Subject: tools/xentop: Fix calculation of used memory X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4b5b431edd984b26f43b3efc7de465f3560a949e;p=people%2Fdwmw2%2Fxen.git tools/xentop: Fix calculation of used memory Used memory should be calculated by subtracting free memory from total memory. Fixes: c588c002cc1 ("tools: remove tmem code and commands") Signed-off-by: Sander Eikelenboom Acked-by: Wei Liu --- diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c index af11ebfbf7..f9f4dfb453 100644 --- a/tools/xenstat/xentop/xentop.c +++ b/tools/xenstat/xentop/xentop.c @@ -969,7 +969,7 @@ void do_summary(void) "%u crashed, %u dying, %u shutdown \n", num_domains, run, block, pause, crash, dying, shutdown); - used = xenstat_node_tot_mem(cur_node); + used = xenstat_node_tot_mem(cur_node) - xenstat_node_free_mem(cur_node); freeable_mb = 0; /* Dump node memory and cpu information */