From: Avi Kivity <avi@redhat.com>
To: Jiaqing Du <jiaqing@gmail.com>
Cc: kvm@vger.kernel.org, Nipun sehrawat <nipunsehrawatns@gmail.com>
Subject: Re: Some Code for Performance Profiling
Date: Mon, 05 Apr 2010 11:34:20 +0300 [thread overview]
Message-ID: <4BB9A08C.4010408@redhat.com> (raw)
In-Reply-To: <6d8082041003310953p33e30819vbb7c2a122bd6becd@mail.gmail.com>
On 03/31/2010 07:53 PM, Jiaqing Du wrote:
> Hi,
>
> We have some code about performance profiling in KVM. They are outputs
> of a school project. Previous discussions in KVM, Perfmon2, and Xen
> mailing lists helped us a lot. The code are NOT in a good shape and
> are only used to demonstrated the feasibility of doing performance
> profiling in KVM. Feel free to use it if you want.
>
Performance monitoring is an important feature for kvm. Is there any
chance you can work at getting it into good shape?
> We categorize performance profiling in a virtualized environment into
> two types: *guest-wide profiling* and *system-wide profiling*. For
> guest-wide profiling, only the guest is profiled. KVM virtualizes the
> PMU and the user runs a profiler directly in the guest. It requires no
> modifications to the guest OS and the profiler running in the guest.
> For system-wide profiling, both KVM and the guest OS are profiled. The
> results are similar to what XenOprof outputs. In this case, one
> profiler running in the host and one profiler running in the guest.
> Still it requires no modifications to the guest and the profiler
> running in it.
>
Can your implementation support both simultaneously?
> For guest-wide profiling, there are two possible places to save and
> restore the related MSRs. One is where the CPU switches between guest
> mode and host mode. We call this *CPU-switch*. Profiling with this
> enabled reflects how the guest behaves on the physical CPU, plus other
> virtualized, not emulated, devices. The other place is where the CPU
> switches between the KVM context and others. Here KVM context means
> the CPU is executing guest code or KVM code, both kernel space and
> user space. We call this *domain-switch*. Profiling with this enabled
> discloses how the guest behaves on both the physical CPU and KVM.
> (Some emulated operations are really expensive in a virtualized
> environment.)
>
Which method do you use? Or do you support both?
Note disclosing host pmu data to the guest is sometimes a security issue.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2010-04-05 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 16:53 Some Code for Performance Profiling Jiaqing Du
2010-04-05 8:34 ` Avi Kivity [this message]
2010-04-07 19:23 ` Jiaqing Du
2010-04-07 19:30 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BB9A08C.4010408@redhat.com \
--to=avi@redhat.com \
--cc=jiaqing@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=nipunsehrawatns@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox