[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/58] cpus: update comments
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 16/58] cpus: update comments |
Date: |
Tue, 13 Sep 2016 19:15:47 +0200 |
From: Cao jin <address@hidden>
The returned value of cpu_get_clock() is plused with the offset,
so it is the time elapsed in virtual machine when vm is active.
Cc: Paolo Bonzini <address@hidden>
Cc Peter Crosthwaite <address@hidden>
Cc: Richard Henderson <address@hidden>
Signed-off-by: Cao jin <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpus.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cpus.c b/cpus.c
index e11caf7..0308431 100644
--- a/cpus.c
+++ b/cpus.c
@@ -191,8 +191,12 @@ int64_t cpu_icount_to_ns(int64_t icount)
return icount << icount_time_shift;
}
-/* return the host CPU cycle counter and handle stop/restart */
-/* Caller must hold the BQL */
+/* return the time elapsed in VM between vm_start and vm_stop. Unless
+ * icount is active, cpu_get_ticks() uses units of the host CPU cycle
+ * counter.
+ *
+ * Caller must hold the BQL
+ */
int64_t cpu_get_ticks(void)
{
int64_t ticks;
@@ -229,7 +233,8 @@ static int64_t cpu_get_clock_locked(void)
return time;
}
-/* return the host CPU monotonic timer and handle stop/restart */
+/* Return the monotonic time elapsed in VM, i.e.,
+ * the time between vm_start and vm_stop */
int64_t cpu_get_clock(void)
{
int64_t ti;
--
1.8.3.1
- [Qemu-devel] [PULL 09/58] tcg: cpu-exec: remove tb_lock from the hot-path, (continued)
- [Qemu-devel] [PULL 09/58] tcg: cpu-exec: remove tb_lock from the hot-path, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 12/58] tcg: rename tb_find_physical(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 06/58] tcg: Prepare safe access to tb_flushed out of tb_lock, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 10/58] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 13/58] rules.mak: Don't extract libs from .mo-libs in link command, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 14/58] timer: update comments, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 15/58] cpus: rename local variable to meaningful one, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 21/58] lsi: never set DMA FIFO Empty (DFE) bit in DSTAT register, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 23/58] scsi-disk: change disk serial length from 20 to 36, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 24/58] vmw_pvscsi: check page count while initialising descriptor rings, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 16/58] cpus: update comments,
Paolo Bonzini <=
- [Qemu-devel] [PULL 19/58] lsi: do not exit QEMU if reading invalid register, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 20/58] lsi: implement I/O memory space for Memory Move instructions, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 17/58] help: Update help to remove misleading display information, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 18/58] lsi: print register names in debug prints, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 22/58] MAINTAINERS: add myself as stubs maintainers, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 25/58] scsi: mptconfig: fix an assert expression, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 26/58] scsi: mptconfig: fix misuse of MPTSAS_CONFIG_PACK, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 27/58] vmxcap: Show raw MSR value, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 28/58] vmxcap: Add TSC scaling bit, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 30/58] chardev: Add 'help' option to print all available chardev backend types, Paolo Bonzini, 2016/09/13