Skip to contentSkip to conversation

Xenoprof in an HVM domain

DISCUSSION Yang, Xiaowei 2 participants 2 messages Apr 24, 2006

lore
Share & tools
lore
#0 lore raw

Hi Steve,
As we know, xenoprof 2.0 is checked in xen-unstable for days. Now I'm writing a patch to add passive domain support (which exists in UP guest age) for smp guest. Using passive domain and my improvement in oprofile (I sent out before), we needn't change guest code and can tune hvm guest in a somewhat raw way -- PC samples from hv and guest kernel can be mapped to functions but all samples from application are only there as a whole. It's enough for tuning hvm performace for now. You are proposing to add active domain support for hvm, right? The apparent advantage is to tune hvm linux applications in future. It should be doable, like we've enabled vbd/vnif in hvm. And it needs more effort in hvm.
Yes, Hypervcall, shared buffer and notification mechanism are all needed. For the last one, one of simple way is: 1) in hvm guest kernel, register for an unused IRQ line 2) in hv, inject that interrupt to hvm when needed. Or you can use a psydo PCI device in qemu to hold one irq number.

Thanks,
-Xiaowei

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Steve Dobbelstein
Sent: 2006年4月21日 13:11
To: [email protected]
Subject: [Xen-devel] Xenoprof in an HVM domain

I'm looking into getting Xenoprof to tun in an HVM domain, since we will eventually need a profiler for HVM domains to track down areas of poor performance. (HVMs have poor performance? :) ) Being relatively new to OProfile, Xenoprof, and Xen internals, I would appreciate any pointers, tips, and comments on how to work the implementation. I see three basic areas of work.

1. Implement hypercalls in HVM domains. This has been done by Steve Ofsthun of Virtual Iron who contributed his patches to the xen-devel list recently. (Thanks, Steve.)

2. Implement the shared buffer that conveys profile events from the hypervisor to the domain. From my initial crawl through the Xenoprof code (see for example linux-2.6-xen-sparse/arch/i386/oprofile/xenoprof.c) it appears that its setup of the shared buffer via hypercalls and page table updates should work in an HVM domain. Correct me if I'm wrong.

3. Implement an interrupt mechanism for the hypervisor to signal the domain that it has more data in the shared buffer. Xenoprof currently sets up an event channel for this. In my initial hack of the code I discovered that the event channel used by Xenoprof conflicts with the 8259 support in the HVM kernel. Since I use the serial interface to the HVM domain, I am hesitant to remove the 8259 support in my HVM kernel. It appears that I need to either get an event channel to work through qemu, preserving the 8259 functionality, or change Xenoprof in the hypervisor to instruct qemu to issue an interrupt to the domain and change Xenoprof in the domain to run off an interrupt instead of an event channel. Or maybe I don't know what I'm talking about and need to be enlightened by those who know better what the issues are.

Any advice is appreciated.

Thanks,
Steve D.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

"Yang, Xiaowei" <[email protected]> wrote on 04/24/2006 02:02:41 AM:

Quoted 2 lines

Hi Steve,
As we know, xenoprof 2.0 is checked in xen-unstable for days.

Yes. That's great. Makes building Xenoprof support much easier.

Quoted 3 lines

Now
I'm writing a patch to add passive domain support (which exists in UP guest age) for smp guest.

Are you saying there is support for passive domains in Xenoprof? If so, I don't see it in xen-unstable. (I just pulled changeset 9734.) It's mentioned in the docs, and some of it appeared in the 0.8.2 patch to the oprofile utilities, but I don't see any support for passive domains in the Xen hypervisor, the Linux sparse tree, nor the oprofile-0.9.1-xen.patch to the oprofile utilities. From what I can see, any events that are not going to an active domain are dropped. Or am I missing something?

Quoted 6 lines

Using passive domain and my improvement
in oprofile (I sent out before), we needn't change guest code and can tune hvm guest in a somewhat raw way -- PC samples from hv and guest kernel can be mapped to functions but all samples from application are only there as a whole. It's enough for tuning hvm performace for now.

If handling passive domains includes resolving symbols in the kernel running in the HVM guest, then that would be sufficient for now. I am looking into performance issues with HVM domains -- networking, disk, memory. Much of that will be kernel code.

Quoted 1 line

You are proposing to add active domain support for hvm, right?

Yes. For a complete profile we would want to include user space applications.

Quoted 9 lines

The
apparent advantage is to tune hvm linux applications in future. It should be doable, like we've enabled vbd/vnif in hvm. And it needs more effort in hvm.
Yes, Hypervcall, shared buffer and notification mechanism are all needed. For the last one, one of simple way is: 1) in hvm guest kernel, register for an unused IRQ line 2) in hv, inject that interrupt to hvm when needed. Or you can use a psydo PCI device in qemu to hold one irq number.

Thanks for the tips.

Steve D.