qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Liebergeld <usenet@gmx.eu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: Precise guest instruction count.
Date: Wed, 11 Mar 2009 11:45:15 +0000 (UTC)	[thread overview]
Message-ID: <gp888b$2ro$1@ger.gmane.org> (raw)
In-Reply-To: 200903100155.22875.paul@codesourcery.com

Hi,

Paul Brook <paul@codesourcery.com> schrieb:
>> 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).

I am using system mode exclusively.

> If you need counts of specific instructions then you probably need to add 
> explicit counters to the implementation of those instructions.

I disabled all timers in Qemu and run a guest program, which includes an
assembly-coded loop. At the start and end of the loop I have a magic
instruction, upon which Qemu prints the current output of cpu_get_clock. I run
qemu with the flag -icount 0.

Still, the delta of those two values does not in any kind resemble the amount
of instructions, and worse it is not constant with subsequent runs.

Can you give any suggestions on how to get a precise absolut guest instruction
count?

Greetings, Steffen

      reply	other threads:[~2009-03-11 11:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09  9:38 [Qemu-devel] Precise guest instruction count Steffen Liebergeld
2009-03-09 21:56 ` Laurent Desnogues
2009-03-11 10:33   ` [Qemu-devel] " Steffen Liebergeld
2009-03-11 10:42     ` Laurent Desnogues
2009-03-11 12:53       ` Steffen Liebergeld
2009-03-11 13:13         ` Paul Brook
2009-03-10  1:55 ` [Qemu-devel] " Paul Brook
2009-03-11 11:45   ` Steffen Liebergeld [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='gp888b$2ro$1@ger.gmane.org' \
    --to=usenet@gmx.eu \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).