From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgrBo-0006u9-2h for qemu-devel@nongnu.org; Mon, 09 Mar 2009 21:55:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgrBm-0006tr-Jg for qemu-devel@nongnu.org; Mon, 09 Mar 2009 21:55:27 -0400 Received: from [199.232.76.173] (port=33835 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgrBm-0006tm-Gz for qemu-devel@nongnu.org; Mon, 09 Mar 2009 21:55:26 -0400 Received: from mx20.gnu.org ([199.232.41.8]:11927) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LgrBm-0001pH-8v for qemu-devel@nongnu.org; Mon, 09 Mar 2009 21:55:26 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LgrBl-0001wm-4Z for qemu-devel@nongnu.org; Mon, 09 Mar 2009 21:55:25 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Precise guest instruction count. Date: Tue, 10 Mar 2009 01:55:22 +0000 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903100155.22875.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Steffen Liebergeld > So my question is how can I get accurate guest instruction count number? -icount maintains an accurate count of the number of instructions executed. However for performance reasons the counter value is not valid at all times. Also note that you can not assume that a whole TB is executed (because of MMU faults, or IO interrupts). Even with -icount, qemu is only deterministic internally. Its behavior can still be influenced by external events. In usermode this could be any syscall. In system mode this could be mouse/keyboard input, modified disk images or network traffic (possibly other things I've missed). If you need counts of specific instructions then you probably need to add explicit counters to the implementation of those instructions. Paul