aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstat/xentop
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:38:18 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:38:18 +0000
commitfc50aaf0d87ae5a59ba849795ad7740b242f6e56 (patch)
treee6fae5c8cf73ede15f4944f7e0ba95b31d0645d8 /tools/xenstat/xentop
parent1fd93d4f8cb8e3a2f5cbf27aaee7dea25842b55b (diff)
downloadxen-fc50aaf0d87ae5a59ba849795ad7740b242f6e56.tar.gz
xen-fc50aaf0d87ae5a59ba849795ad7740b242f6e56.tar.bz2
xen-fc50aaf0d87ae5a59ba849795ad7740b242f6e56.zip
xentop: Add tmem-freeable info when tmem is active
(No change to xentop output when tmem is inactive.) Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Diffstat (limited to 'tools/xenstat/xentop')
-rw-r--r--tools/xenstat/xentop/xentop.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c
index cb067ae281..2e6634948b 100644
--- a/tools/xenstat/xentop/xentop.c
+++ b/tools/xenstat/xentop/xentop.c
@@ -799,6 +799,7 @@ void do_summary(void)
crash = 0, dying = 0, shutdown = 0;
unsigned i, num_domains = 0;
unsigned long long used = 0;
+ long freeable_mb = 0;
xenstat_domain *domain;
time_t curt;
@@ -825,12 +826,18 @@ void do_summary(void)
num_domains, run, block, pause, crash, dying, shutdown);
used = xenstat_node_tot_mem(cur_node)-xenstat_node_free_mem(cur_node);
+ freeable_mb = xenstat_node_freeable_mb(cur_node);
/* Dump node memory and cpu information */
- print("Mem: %lluk total, %lluk used, %lluk free "
- "CPUs: %u @ %lluMHz\n",
+ if ( freeable_mb <= 0 )
+ print("Mem: %lluk total, %lluk used, %lluk free ",
xenstat_node_tot_mem(cur_node)/1024, used/1024,
- xenstat_node_free_mem(cur_node)/1024,
+ xenstat_node_free_mem(cur_node)/1024);
+ else
+ print("Mem: %lluk total, %lluk used, %lluk free, %ldk freeable, ",
+ xenstat_node_tot_mem(cur_node)/1024, used/1024,
+ xenstat_node_free_mem(cur_node)/1024, freeable_mb*1024);
+ print("CPUs: %u @ %lluMHz\n",
xenstat_node_num_cpus(cur_node),
xenstat_node_cpu_hz(cur_node)/1000000);
}