qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: Precise guest instruction count.


From: Steffen Liebergeld
Subject: [Qemu-devel] Re: Precise guest instruction count.
Date: Wed, 11 Mar 2009 11:45:15 +0000 (UTC)
User-agent: slrn/pre0.9.9-111 (Linux)

Hi,

Paul Brook <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]