qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Precise guest instruction count.
@ 2009-03-09  9:38 Steffen Liebergeld
  2009-03-09 21:56 ` Laurent Desnogues
  2009-03-10  1:55 ` [Qemu-devel] " Paul Brook
  0 siblings, 2 replies; 8+ messages in thread
From: Steffen Liebergeld @ 2009-03-09  9:38 UTC (permalink / raw)
  To: qemu-devel

Hi Qemu developers,

I am trying to do some measurements in Qemu.

I want to get the precise number of guest instructions at certain points in
the emulation. The output is triggered by a NOP guest instruction with a
special value in two registers (to rule out other NOPs).

I have difficulties getting to know the number of guest instructions. I tried
to use the -icount switch, but this leads to timeout errors whenever the guest
tries to use the network. So I inserted a line into gen_icount_end, which
,regardless of the value use_icount, increments qemu_icount by num_insns. I
assume, that the code of gen_icount_end is appended to all TBs and run
whenever the TB is run (please correct me if I'm wrong).

I have some code in the guest, which does some calculations. I let it do the
calculations several times in a row, always discarding the results of the
previous run. I trigger the NOP always before the calculation and Qemu gives
me the following as values of qemu_icount:
First run:  835032
Second run: 837176
Third run:  837179
Fourth and subsequent runs: 837180

I guess that the behaviour is caused by chaining of TBs. The execution flow
jumps directly to the next TB without running the code of gen_icount_end at
the end of the TB.

I do not use Kqemu for this test.

So my question is how can I get accurate guest instruction count number?

Any help is appreciated.

Steffen Liebergeld

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-03-11 13:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [Qemu-devel] " Steffen Liebergeld

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).