From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Find timing info between two VM exits Date: Tue, 25 Dec 2007 09:25:39 +0200 Message-ID: <4770B073.8070404@qumranet.com> References: <476F5A43.2060605@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: avadh patel Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.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/