From: Paolo Bonzini <pbonzini@redhat.com>
To: Sebastian Tanase <sebastian.tanase@openwide.fr>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@amazon.com,
wenchaoqemu@gmail.com, quintela@redhat.com, mst@redhat.com,
stefanha@redhat.com, armbru@redhat.com, lcapitulino@redhat.com,
michael@walle.cc, camille.begue@openwide.fr, alex@alex.org.uk,
crobinso@redhat.com, afaerber@suse.de, rth@twiddle.net
Subject: Re: [Qemu-devel] [RFC PATCH V4 6/6] monitor: Add drift info to 'info jit'
Date: Wed, 16 Jul 2014 15:18:33 +0200 [thread overview]
Message-ID: <53C67BA9.50009@redhat.com> (raw)
In-Reply-To: <1405513086-31246-7-git-send-email-sebastian.tanase@openwide.fr>
Il 16/07/2014 14:18, Sebastian Tanase ha scritto:
> - static int64_t clocks_offset;
> - if (!icount_align_option) {
> - return;
> + static int64_t realtime_clock_value;
Does this really need to be static?
> + if (icount_align_option || !realtime_clock_value) {
> + realtime_clock_value = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
> }
> - sc->realtime_clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
> /* Compute offset between the 2 clocks. */
> if (!clocks_offset) {
> - clocks_offset = sc->realtime_clock -
> + clocks_offset = realtime_clock_value -
> qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
> }
Isn't clocks_offset roughly the same as -timers_state.cpu_clock_offset?
If so, you could be some simplification in the code. Feel free to
move the TimersState struct definition to include/sysemu/cpus.h and make
timers_state public.
> + cpu_fprintf(f, "Host - Guest clock %ld(ms)\n",
> + (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - clocks_offset -
> + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL))/SCALE_MS);
I think this is (cpu_get_clock() - cpu_get_icount()) / SCALE_MS.
Paolo
next prev parent reply other threads:[~2014-07-16 13:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 12:18 [Qemu-devel] [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest and host clocks Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 1/6] icount: Add QemuOpts for icount Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 2/6] icount: Add align option to icount Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 3/6] icount: Make icount_time_shift available everywhere Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 4/6] cpu_exec: Add sleeping algorithm Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 5/6] cpu_exec: Print to console if the guest is late Sebastian Tanase
2014-07-16 12:18 ` [Qemu-devel] [RFC PATCH V4 6/6] monitor: Add drift info to 'info jit' Sebastian Tanase
2014-07-16 13:18 ` Paolo Bonzini [this message]
2014-07-22 9:58 ` Sebastian Tanase
2014-07-22 10:19 ` Paolo Bonzini
2014-07-22 13:55 ` Sebastian Tanase
2014-07-16 13:20 ` [Qemu-devel] [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest and host clocks Paolo Bonzini
2014-07-22 14:02 ` Sebastian Tanase
2014-07-22 14:59 ` Paolo Bonzini
2014-07-22 15:17 ` Sebastian Tanase
2014-07-22 15:22 ` Paolo Bonzini
2014-07-22 15:28 ` Sebastian Tanase
2014-07-22 15:44 ` Paolo Bonzini
2014-07-16 13:40 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C67BA9.50009@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=alex@alex.org.uk \
--cc=aliguori@amazon.com \
--cc=armbru@redhat.com \
--cc=camille.begue@openwide.fr \
--cc=crobinso@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=michael@walle.cc \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=sebastian.tanase@openwide.fr \
--cc=stefanha@redhat.com \
--cc=wenchaoqemu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).