public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: avadh patel <avadh4all-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Find timing info between two VM exits
Date: Tue, 25 Dec 2007 09:25:39 +0200	[thread overview]
Message-ID: <4770B073.8070404@qumranet.com> (raw)
In-Reply-To: <c09e7eee0712240746q4022d5e6v364ab7d491ae80ec-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

avadh patel wrote:
> Hi Avi,
>
> Sorry for the wrong question. My revised question is as follows:
> How can I find the time spent between vm-enter and vm-exit ?
> In other words, How can I find the number of clock ticks spent in 
> execution of VM's code between vm-enter and vm-exit ?

Linux 2.6.24 supports guest time counters in /proc/pid/stat; these sum 
up the amount of real time spent inside the guest.  To get clock tick 
counts, you can add rdtsc calls in vmx_vcpu_run or svm_vcpu_run, before 
and after the big asm block.


-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

      parent reply	other threads:[~2007-12-25  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-24  0:55 Find timing info between two VM exits avadh patel
     [not found] ` <c09e7eee0712231655n3b0150a2kab4f261ebea8aff5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-12-24  7:05   ` Avi Kivity
     [not found]     ` <476F5A43.2060605-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-24 15:46       ` avadh patel
     [not found]         ` <c09e7eee0712240746q4022d5e6v364ab7d491ae80ec-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-12-25  7:25           ` Avi Kivity [this message]

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=4770B073.8070404@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=avadh4all-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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