[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] tools/xentop: Fix calculation of used memory

commit 4b5b431edd984b26f43b3efc7de465f3560a949e
Author:     Sander Eikelenboom <linux@xxxxxxxxxxxxxx>
AuthorDate: Wed Feb 19 21:31:30 2020 +0100
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Thu Feb 20 12:03:21 2020 +0000

    tools/xentop: Fix calculation of used memory
    Used memory should be calculated by subtracting free memory from total
    Fixes: c588c002cc1 ("tools: remove tmem code and commands")
    Signed-off-by: Sander Eikelenboom <linux@xxxxxxxxxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
 tools/xenstat/xentop/xentop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
generated by git-patchbot for /home/xen/git/xen.git#staging

Xen-changelog mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.