ia64/xen-unstable

view tools/xenballoon/xenballoon-monitor @ 19731:01748ccc4da3

Intel VT-d: fix Stoakley boot issue with iommu=1

Signed-off-by: Weidong Han <Weidong.han@intel.com>
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 05 09:25:50 2009 +0100 (2009-06-05)
parents 0c5183e764d8
children 8373971089a7
line source
1 #!/bin/bash
2 #
3 # xenballoon-monitor - monitor certain stats from xenballoond
4 # (run in dom0 with "watch -d xenballoon-monitor" for xentop-like output)
5 #
6 # Copyright (C) 2009 Oracle Corporation and/or its affiliates.
7 # All rights reserved
8 # Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
9 #
10 # Hint: Use "xm sched-credit -d 0 -w 2000" to watch on heavily loaded machines
11 #
12 echo "id mem-kb tgt-kb commit swapin swapout pgin pgout active(sec)"
13 for i in `xenstore-list /local/domain`; do
14 if [ "$i" -ne 0 ]; then
15 tot=0; tgt=0; sin=0; sout=0; pgin=0; pgout=0; cmt=0; up=0; idle=0; act=0;
16 if xenstore-exists /local/domain/$i/memory/meminfo; then
17 tot=`xenstore-read /local/domain/$i/memory/meminfo | grep MemTotal \
18 | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'`
19 cmt=`xenstore-read /local/domain/$i/memory/meminfo | grep Committed_AS \
20 | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'`
21 fi
22 if xenstore-exists /local/domain/$i/memory/selftarget; then
23 tgt=`xenstore-read /local/domain/$i/memory/selftarget`
24 fi
25 if xenstore-exists /local/domain/$i/memory/vmstat; then
26 sin=`xenstore-read /local/domain/$i/memory/vmstat | grep pswpin \
27 | cut -d" " -f2`
28 sout=`xenstore-read /local/domain/$i/memory/vmstat | grep pswpout \
29 | cut -d" " -f2`
30 pgin=`xenstore-read /local/domain/$i/memory/vmstat | grep pgpgin \
31 | cut -d" " -f2`
32 pgout=`xenstore-read /local/domain/$i/memory/vmstat | grep pgout \
33 | cut -d" " -f2`
34 fi
35 if xenstore-exists /local/domain/$i/memory/uptime; then
36 up=`xenstore-read /local/domain/$i/memory/uptime | cut -d" " -f1`
37 idle=`xenstore-read /local/domain/$i/memory/uptime | cut -d" " -f2`
38 act=`echo $up - $idle | bc -iq`
39 fi
40 printf "%2d %8d%8d%8d%9d%9d%10d%10d%10.2f\n" $i $tot $tgt $cmt $sin $sout $pgin $pgout $act
41 fi
42 done
43 echo Free memory: `xm info | grep free | sed 's/[^1-9]*\([1-9][0-9]*\).*/\1/'` MB