Skip to contentSkip to conversation

Attempt for reproducible behavior

Qemu-devel Alex-Uni 2 participants 2 messages Feb 26, 2009

lore
Share & tools
lore

Alex-Uni

author
#0 lore raw

Hello,

I am trying to modify Qemu, so it offers reproducible behavior. I'm using the icounts for the time measurement.
For example:
I have a simple code which measures the time before the start of a loop. The loop runs for an definite amount of rounds. In this case I let it count to 100000000 in a while-loop. Then the codes measures the time after the loop. Both times in milliseconds. The time difference is about 5000 milliseconds.

Now, while the loop is still running, i make a snapshot. Lets say at 2000 milliseconds. After loading this snapshot it the loop should run for 3000 milliseconds. But it doesnt, it's alway different.

I figured, that it depends on the value of next_tb and therefor on tcg_qemu_tb_exec(tc_ptr) in line 615 in the cpu-exec.c.

Now I have the problem, that I can't follow the code. I don't know why tcg_qemu_tb_exec(tc_ptr) produces different results and where to look. I only found the define in the tcg.h.

Can somebody help me with this problem?
I'm working on the svn-version 5806.

Thank you
Alex
(Please CC: me when replying, I am not on the list)

#1 lore raw

Am Donnerstag, 26. Februar 2009 13:44:15 schrieb Alex-Uni:

Quoted 2 lines

I am trying to modify Qemu, so it offers reproducible behavior. I'm using the icounts for the time measurement.

qemu is not cycle accurate. Its using code translation with some quite cleveer caching.

Perhapps Bochs is the better alternative to work on for your problem.

With regards,
Jan