From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFmF7-0002ur-1h for qemu-devel@nongnu.org; Fri, 08 Aug 2014 11:38:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFmF0-0006ND-TR for qemu-devel@nongnu.org; Fri, 08 Aug 2014 11:38:09 -0400 Received: from zimbra3.corp.accelance.fr ([2001:4080:204::2:8]:41727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFmF0-0006Mn-LG for qemu-devel@nongnu.org; Fri, 08 Aug 2014 11:38:02 -0400 Date: Fri, 8 Aug 2014 17:37:53 +0200 (CEST) From: Sebastian Tanase Message-ID: <1735826913.23298264.1407512273412.JavaMail.root@openwide.fr> In-Reply-To: <1407418489-19729-2-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL v2 10/11] monitor: Add drift info to 'info jit' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org ----- Mail original ----- > De: "Paolo Bonzini" > =C3=80: qemu-devel@nongnu.org > Cc: "Sebastian Tanase" > Envoy=C3=A9: Jeudi 7 Ao=C3=BBt 2014 15:34:49 > Objet: [PULL v2 10/11] monitor: Add drift info to 'info jit' >=20 > From: Sebastian Tanase >=20 > Show in 'info jit' the current delay between the host clock > and the guest clock. In addition, print the maximum advance > and delay of the guest compared to the host. >=20 > Signed-off-by: Sebastian Tanase > Tested-by: Camille B=C3=A9gu=C3=A9 > Signed-off-by: Paolo Bonzini > --- > cpu-exec.c | 6 ++++++ > cpus.c | 19 +++++++++++++++++++ > include/qemu-common.h | 4 ++++ > monitor.c | 1 + > 4 files changed, 30 insertions(+) >=20 > diff --git a/cpu-exec.c b/cpu-exec.c > index 3c14502..cbc8067 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c > @@ -105,6 +105,12 @@ static void init_delay_params(SyncClocks *sc, > sc->realtime_clock + > cpu_get_clock_offset(); > sc->last_cpu_icount =3D cpu->icount_extra + > cpu->icount_decr.u16.low; > + if (sc->diff_clk < max_delay) { > + max_delay =3D sc->diff_clk; > + } > + if (sc->diff_clk > max_advance) { > + max_advance =3D sc->diff_clk; > + } > =20 > /* Print every 2s max if the guest is late. We limit the number > of printed messages to NB_PRINT_MAX(currently 100) */ > diff --git a/cpus.c b/cpus.c > index 19245e9..2b5c0bd 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -64,6 +64,8 @@ > #endif /* CONFIG_LINUX */ > =20 > static CPUState *next_cpu; > +int64_t max_delay; > +int64_t max_advance; > =20 > bool cpu_is_stopped(CPUState *cpu) > { > @@ -1552,3 +1554,20 @@ void qmp_inject_nmi(Error **errp) > error_set(errp, QERR_UNSUPPORTED); > #endif > } > + > +void dump_drift_info(FILE *f, fprintf_function cpu_fprintf) > +{ > + if (!use_icount) { > + return; > + } > + > + cpu_fprintf(f, "Host - Guest clock %"PRIi64" ms\n", > + (cpu_get_clock() - cpu_get_icount())/SCALE_MS); > + if (icount_align_option) { > + cpu_fprintf(f, "Max guest delay %"PRIi64" ms\n", > -max_delay/SCALE_MS); > + cpu_fprintf(f, "Max guest advance %"PRIi64" ms\n", > max_advance/SCALE_MS); > + } else { > + cpu_fprintf(f, "Max guest delay NA\n"); > + cpu_fprintf(f, "Max guest advance NA\n"); > + } > +} Thank you very much for fixing this. I must have missed it somehow. Best regards, Sebastian > diff --git a/include/qemu-common.h b/include/qemu-common.h > index 5d10ac2..bcf7a6a 100644 > --- a/include/qemu-common.h > +++ b/include/qemu-common.h > @@ -109,6 +109,10 @@ static inline char *realpath(const char *path, > char *resolved_path) > void configure_icount(QemuOpts *opts, Error **errp); > extern int use_icount; > extern int icount_align_option; > +/* drift information for info jit command */ > +extern int64_t max_delay; > +extern int64_t max_advance; > +void dump_drift_info(FILE *f, fprintf_function cpu_fprintf); > =20 > #include "qemu/osdep.h" > #include "qemu/bswap.h" > diff --git a/monitor.c b/monitor.c > index 5bc70a6..cdbaa60 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -1047,6 +1047,7 @@ static void do_info_registers(Monitor *mon, > const QDict *qdict) > static void do_info_jit(Monitor *mon, const QDict *qdict) > { > dump_exec_info((FILE *)mon, monitor_fprintf); > + dump_drift_info((FILE *)mon, monitor_fprintf); > } > =20 > static void do_info_history(Monitor *mon, const QDict *qdict) > -- > 1.8.3.1 >=20