struct TimerState
Hi
I am trying to understand the structures that QEMU saves when do_savevm() is invoked. Can anyone explain to me the fields that are part of the TimerState structure in qemu-timer.c?
Thanks
Nilay
Quoted 3 lines · Nilay
I am trying to understand the structures that QEMU saves when
do_savevm()is invoked. Can anyone explain to me the fields that are part of the TimerState structure inqemu-timer.c?
If my meory does not fail me, its main task is to capture what is the time in the host whenever the VM is started and stopped.
This is later used to adapt the VM time when using icount in adaptive mode (-icount=auto). I remember seeing it used somewhere else, but right now I cannot recall exactly what for.
This reminds me that I've been navigating through all the time-related code in QEMU and, in order to make it more easy to follow, I've started separating the routines in qemu-timer into different files (e.g., qemu-htime and qemu-vtime for routines accessing time sources in the host and in the VM). I will send the patches as soon as I finish the rewrite.
Lluis
Signature · 4 lines
"And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth
Quoted 13 lines · Lluís
Quoted 3 lines · Nilay
I am trying to understand the structures that QEMU saves when
do_savevm()is invoked. Can anyone explain to me the fields that are part of the TimerState structure inqemu-timer.c?If my meory does not fail me, its main task is to capture what is the time in the host whenever the VM is started and stopped.
This is later used to adapt the VM time when using icount in adaptive mode (-icount=auto). I remember seeing it used somewhere else, but right now I cannot recall exactly what for.
Quoted 7 lines
This reminds me that I've been navigating through all the time-related code in QEMU and, in order to make it more easy to follow, I've started separating the routines in qemu-timer into different files (e.g., qemu-htime and qemu-vtime for routines accessing time sources in the host and in the VM). I will send the patches as soon as I finish the rewrite.
Let me ask a more pointed question. Is there a way to know how many cycles the virtual machine has been running for? A comment that appears before the defintion of the TimerState structure -- guest cycle counter. As per Lluis' reply, this structure is keeping track of the time when the VM started. Can you determine this from the variables that are part of this structure?
Thanks
Nilay
Quoted 4 lines · Nilay Vaish
Let me ask a more pointed question. Is there a way to know how many cycles the virtual machine has been running for? A comment that appears before the defintion of the TimerState structure -- guest cycle counter.
AFAIR, the TimerState captures the amount of host nsec/cycles that the VM has been stopped for since the last VM stop/start pair.
Quoted 3 lines
As per Lluis' reply, this structure is keeping track of the time when the VM started. Can you determine this from the variables that are part of this structure?
Determine what? The amount of host nsec/cycles or the amount of guest nsec/cycles?
The former cannot be directly obtained unless you aggregate the intermediate values in TimerState (although you're already able to get that information from the OS). The latter depends under which configuration you're executing (i.e., use_icount).
Lluis
Signature · 4 lines
"And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth
Quoted 15 lines · Lluís
Quoted 4 lines · Nilay Vaish
Let me ask a more pointed question. Is there a way to know how many cycles the virtual machine has been running for? A comment that appears before the defintion of the TimerState structure -- guest cycle counter.
AFAIR, the TimerState captures the amount of host nsec/cycles that the VM has been stopped for since the last VM stop/start pair.
Quoted 3 lines
As per Lluis' reply, this structure is keeping track of the time when the VM started. Can you determine this from the variables that are part of this structure?
Quoted 8 lines
Determine what? The amount of host nsec/cycles or the amount of guest nsec/cycles?
The former cannot be directly obtained unless you aggregate the intermediate values in TimerState (although you're already able to get that information from the OS). The latter depends under which configuration you're executing (i.e.,
use_icount).
I would like to determine the later. icount will give the instruction count. I need the instruction count as well, but is there some way to determine the guest cycles as well?
--
Nilay
Quoted 3 lines · Nilay Vaish
I would like to determine the later. icount will give the instruction count. I need the instruction count as well, but is there some way to determine the guest cycles as well?
On the current implementation, the number of cycles is directly related to the icount, so what you want is 'cpu_get_icount'.
Lluis
Signature · 4 lines
"And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth
Am 21.06.2011 um 12:24 schrieb Nilay Vaish:
Quoted 1 line
Is there a way to know how many cycles the virtual machine has been running for?
No. QEMU's emulation is not cycle-accurate.
The instruction counter (icount) gives you an indication of how much workload the guest has processed but no indication how much time that would've corresponded to.
Andreas
Quoted 9 lines · Andreas F�rber
Am 21.06.2011 um 12:24 schrieb Nilay Vaish:
Quoted 1 line
Is there a way to know how many cycles the virtual machine has been running for?
No. QEMU's emulation is not cycle-accurate.
The instruction counter (icount) gives you an indication of how much workload the guest has processed but no indication how much time that would've corresponded to.
Andreas
Lluis and Andreas, thanks for answering my questions.
Can you tell me where can I find documentation about APIC?
Thanks
Nilay