]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
tools/xentop: Fix calculation of used memory
authorSander Eikelenboom <linux@eikelenboom.it>
Wed, 19 Feb 2020 20:31:30 +0000 (21:31 +0100)
committerWei Liu <wl@xen.org>
Thu, 20 Feb 2020 12:03:21 +0000 (12:03 +0000)
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 <linux@eikelenboom.it>
Acked-by: Wei Liu <wl@xen.org>
tools/xenstat/xentop/xentop.c

index af11ebfbf7fe41645d4b65dbc4a38a81fa9dfea9..f9f4dfb453f98eeb5557dcb0809c60731732f983 100644 (file)
@@ -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 */