From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: KVM Virtual CPU time profiling Date: Fri, 22 Jan 2010 10:38:47 +0800 Message-ID: <201001221038.47885.sheng@linux.intel.com> References: <4158487B9DEE0647BA23911D1C22795712F2245FDB@orsmsx501.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: "Saksena, Abhishek" To: kvm@vger.kernel.org Return-path: Received: from mga10.intel.com ([192.55.52.92]:29343 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755716Ab0AVCjW (ORCPT ); Thu, 21 Jan 2010 21:39:22 -0500 In-Reply-To: <4158487B9DEE0647BA23911D1C22795712F2245FDB@orsmsx501.amr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Friday 22 January 2010 02:41:35 Saksena, Abhishek wrote: > Hi All, > Is there a way in KVM to measure the real physical (CPU) time consumed by > each running Virtual CPU? (I want to do time profiling of the virtual > machines running on host system) > > Also, is there an explanation somewhere on how Virtual CPU scheduling is > achieved in KVM? Thanks Each VM is a QEmu process, and each vcpu is a thread of it(but not all the threads are vcpus). Currently the KVM related scheduler algorithm is the same as other host threads/processes. You can get thread_id for each vcpu in QEmu monitor, by: (qemu) info cpus Then, you can do anything you want with it, e.g. using top to got each thread/vcpu's CPU time. :) -- regards Yang, Sheng