티스토리 뷰

Install Xen 
># apt-get install xen-hypervisor-3.2-1-amd64 xen-linux-system-2.6.26-2-xen-amd64 linux-image-2.6.26-2-xen-amd64 linux-modules-2.6.26-2-xen-amd64 linux-headers-2.6.26-2-xen-amd64 linux-headers-2.6.26-2-common-xen xen-tools

Since we are going to use image-based VM, let's increase the limit on loop device. 
># vim /etc/modules
loop max_loop=64

Next, we need to config the xen
># vim /etc/xen/xend-config.sxp
...
(network-script network-bridge)
#(network-script network-dummy)
(vif-script vif-bridge)
...

># reboot
># ifconfig

Installing VM
Need to edit xen-tools.conf
># vim /etc/xen-tools/xen-tools.conf
...
dir = /home/xen
dist = lenny
gateway = 1921.68.1.1
netmask = 255.255.255.0
broadcast = 192.168.1.255
serial_device = hvc0
disk_device = xvda
...
># mkdir /home/xen

># vim /etc/xen-tools/partitions.d/green
[root]
size=2G
type=ext3
mountpoint=/
options=sync,errors=remount-ro

[swap]
size=512M
type=swap

># sudo xen-create-image --hostname=green1 --ip=192.168.1.164  --size=2Gb  --memory=512Mb  --arch=amd64 --partitions=green  --force --boot --passwd --role udev

Installing Xenoprofile from source code. 

After the xenoprofile installation
># opcontrol --init

Make sure that active_domains and passive_domains are listed. 
># find /dev/oprofile

Now it's time to test Xenoprofile
* We need to have xen-syms and vmlinux so let's just build a xen package from scratch.
Building debian packages from source
1. linux-image-*-xen to get the vmlinuz file
># apt-get build-dep linux-image-2.6.26-2-xen-amd64
># apt-get source linux-image-2.6.26-2-xen-amd64

We need to add more PROFILE options to .config
* I thought by doing this would enable hardware performance counter, but I just realized that I need to patch kernel to support hardware performance counters. This left as future work. No time at the moment!!
So currently the system only supports timer interrupt. 

># vim arch/x86/Kconfig
...
### Arch settings
config X86
    def_bool y
    select HAVE_UNSTABLE_SCHED_CLOCK
    select HAVE_IDE
    select HAVE_OPROFILE
    select PANEL_PROFILE
    select HAVE_KPROBES
...

#modified
config OPROFILE_IBS
    def_bool y

config BRANCH_PROFILE_NONE
    def_bool y

config EVENT_PROFILE
    def_bool y

># dpkg-buildpackage -uc -B

># cp ~/src/linux-2.6-2.6.26/debian/build/build_amd64_xen_amd64/vmlinux /boot/vmlinux-`uname -r`

2. trying to get the xen-syms file
># apt-get build-dep xen-hypervisor-3.2-1-amd64
># apt-get source -b xen-hypervisor-3.2-1-amd64
># cp ~/src/xen-3-3.2.1/debian/build/build-hypervisor_amd64_amd64/xen/xen-syms /boot/xen-syms-`uname -r`

Profiling from dom0 just for testing
* oprofile-0.9.5 with xen patch does not work on this system. Just use the binary format. 
dom0># apt-get install oprofile
dom0># opcontrol --init
dom0># opcontrol --start --vmlinux=/boot/vmlinux-2.6.26-2-xen-amd64
dom0># stress -t 10 -c 1
dom0># opcontrol --dump
dom0># opcontrol --shutdown
dom0># opreport -lt1


Active Profiling
Copy two images to DomUs
># scp /boot/xen-syms-2.6.26-2-xen-amd64 green1:/boot
># scp /boot/xen-syms-2.6.26-2-xen-amd64 green2:/boot

># scp /boot/vmlinux-2.6.26-2-xen-amd64 green1:/boot
># scp /boot/vmlinux-2.6.26-2-xen-amd64 green2:/boot

Initialize
dom0># opcontrol --reset
dom2># opcontrol --reset
dom3># opcontrol --reset

Start OProfile in all domU
dom0># opcontrol --start-daemon --event=CPU_CLK_UNHALTED:6000 --xen=/boot/xen-syms-2.6.26-2-xen-amd64 --vmlinux=/boot/vmlinux-2.6.26-2-xen-amd64  --active-domains=1,2
dom2># opcontrol --start --xen=/boot/xen-syms-2.6.26-2-xen-amd64 --vmlinux=/boot/vmlinux-2.6.26-2-xen-amd64
dom3># opcontrol --start --event=CPU_CLK_UNHALTED:6000 --xen=/xen-syms-2.6.26-2-xen-amd64 --vmlinux=/boot/
vmlinux-2.6.26-2-xen-amd64
Start profiling 
dom0># opcontrol --start

Run experiments to be profiled
dom2># ./loop

Stop profiling
dom0># opcontrol --stop

Shutdown OProfile daemon
dom0># opcontrol --shutdown
dom2># opcontrol --shutdown
dom3># opcontrol --shutdown

dom0># opreport -lt1
error: no sample files found: profile specification too strict 
I am not sure why this is the case. 



Passive Profiling
It seems like opcontrol doesn not have --passive-domains options. I have oprofile 0.9.6 version. 

dom0># opcontrol --reset
dom0># opcontrol --start-daemon --event=CPU_CLK_UNHALTED:6000 --xen=/boot/xen-syms-4.0.1-rc3 --vmlinux=/boot/vmlinux-2.6.31.12-xen  --passive-domains=2,3 --passive-images=/boot/vmlinux-2.6.31.12-xen,/boot/vmlinux-2.6.31.12-xen

dom0># opcontrol --start

Run experiments to be profiled

dom0># opcontrol --stop
dom0># opcontrol --shutdown
dom0># opreport -lt1


References
2. Virtulization with Xen on Debian Lenny (5.0, AMD64), http://www.howtoforge.com/virtualization-with-xen-on-debian-lenny-amd64
3. Virtulization with Xen 3.3.1 on Debian Etch (4.0), http://www.howtoforge.com/virtualization-with-xen-3.3.1-on-debian-etch
4. Apt, dpkg Quick Reference Sheet, http://www.cyberciti.biz/ref/apt-dpkg-ref.html
8. 
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함