From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X04v0-0005mD-CW for qemu-devel@nongnu.org; Thu, 26 Jun 2014 04:20:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X04uv-0005UV-NQ for qemu-devel@nongnu.org; Thu, 26 Jun 2014 04:20:30 -0400 Received: from greensocs.com ([178.33.234.66]:55689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X04uv-0005U4-CG for qemu-devel@nongnu.org; Thu, 26 Jun 2014 04:20:25 -0400 Message-ID: <53ABD7C7.8030003@greensocs.com> Date: Thu, 26 Jun 2014 10:20:23 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1403709607-6434-1-git-send-email-fred.konrad@greensocs.com> <1403709607-6434-10-git-send-email-fred.konrad@greensocs.com> <534C5107B281854290643468BBAAD41F172901@G08CNEXMBPEKD01.g08.fujitsu.local> <53ABCB86.9010000@greensocs.com> <534C5107B281854290643468BBAAD41F172C78@G08CNEXMBPEKD01.g08.fujitsu.local> In-Reply-To: <534C5107B281854290643468BBAAD41F172C78@G08CNEXMBPEKD01.g08.fujitsu.local> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] =?gb2312?b?tPC4tDogtPC4tDogIFtSRkMgUEFUQ0ggdjUgMDkv?= =?gb2312?b?MTNdIGludHJvZHVjZSByZXZlcnNlIGV4ZWN1dGlvbiBtZWNoYW5pc20u?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "lig.fnst@cn.fujitsu.com" , "qemu-devel@nongnu.org" Cc: "peter.maydell@linaro.org" , "quintela@redhat.com" , "mark.burton@greensocs.com" , "dgilbert@redhat.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "vilanova@ac.upc.edu" On 26/06/2014 10:17, lig.fnst@cn.fujitsu.com wrote: >> -----=D3=CA=BC=FE=D4=AD=BC=FE----- >> =B7=A2=BC=FE=C8=CB: Frederic Konrad [mailto:fred.konrad@greensocs.com] >> =B7=A2=CB=CD=CA=B1=BC=E4: 2014=C4=EA6=D4=C226=C8=D5 15:28 >> =CA=D5=BC=FE=C8=CB: Li, Guang/=C0=EE =B9=E3; qemu-devel@nongnu.org >> =B3=AD=CB=CD: peter.maydell@linaro.org; quintela@redhat.com; >> mark.burton@greensocs.com; dgilbert@redhat.com; amit.shah@redhat.com; >> pbonzini@redhat.com; vilanova@ac.upc.edu >> =D6=F7=CC=E2: Re: =B4=F0=B8=B4: [Qemu-devel] [RFC PATCH v5 09/13] intr= oduce reverse >> execution mechanism. >> >> On 26/06/2014 04:31, lig.fnst@cn.fujitsu.com wrote: >>> Hi, >> Hi, >> >>>> -----=D3=CA=BC=FE=D4=AD=BC=FE----- >>>> =B7=A2=BC=FE=C8=CB: qemu-devel-bounces+lig.fnst=3Dcn.fujitsu.com@non= gnu.org >>>> [mailto:qemu-devel-bounces+lig.fnst=3Dcn.fujitsu.com@nongnu.org] =B4= =FA=B1=ED >>>> fred.konrad@greensocs.com >>>> =B7=A2=CB=CD=CA=B1=BC=E4: 2014=C4=EA6=D4=C225=C8=D5 23:20 >>>> =CA=D5=BC=FE=C8=CB: qemu-devel@nongnu.org >>>> =B3=AD=CB=CD: peter.maydell@linaro.org; quintela@redhat.com; >>>> mark.burton@greensocs.com; dgilbert@redhat.com; >> amit.shah@redhat.com; >>>> pbonzini@redhat.com; vilanova@ac.upc.edu; fred.konrad@greensocs.com >>>> =D6=F7=CC=E2: [Qemu-devel] [RFC PATCH v5 09/13] introduce reverse ex= ecution >>>> mechanism. >>>> >>>> From: KONRAD Frederic >>>> >>>> This introduces the basic reverse-execution mechanism. >>>> >>>> Signed-off-by: KONRAD Frederic >>>> --- >>>> Makefile.target | 1 + >>>> cpus.c | 6 + >>>> include/reverse-execution.h | 41 ++++++ >>>> reverse-execution.c | 306 >>>> ++++++++++++++++++++++++++++++++++++++++++++ >>>> vl.c | 7 +- >>>> 5 files changed, 360 insertions(+), 1 deletion(-) create mode 1006= 44 >>>> include/reverse-execution.h create mode 100644 reverse-execution.c >> [...] >>>> + >>>> +static QLIST_HEAD(, snapshot_entry) snapshot =3D >>>> +QLIST_HEAD_INITIALIZER(snapshot); >>>> + >>>> +QEMUTimer *snap_timer; >>> s/snap_/snapshot_/g ? >>> >>>> +QEMUTimer *stop_timer; >>>> + >>>> +struct cexe_state { >>>> + int stepping_back; >>>> + int continue_backward_mode; >>>> + int singlestep_was_enabled; >>> boolize these 3 vars? >>> >>>> + bool step_done; >> Thanks for having looking into this, >> I'll do these change. >> >>>> + saved_vm_running =3D runstate_is_running(); >>>> + vm_stop(RUN_STATE_SAVE_VM); >>>> + snap->time =3D qemu_clock_get_ns(QEMU_CLOCK_ICOUNT); >>>> + sprintf(filename, ".save%04u", snap->id); >>> File name should be more readable >> What do you mean by more readable? > e.g. > gdb-reverse-step-saved-01 > gdb-reverse-step-saved-02 > ... Ok understood, it makes sense. Thanks, Fred >>>> + >>>> + trace_snap_callback(snap->time, filename); >>>> + >>>> + file =3D qemu_fopen(filename, "wb"); >>>> + qemu_savevm_state(file); >>>> + qemu_fclose(file); >>>> + >>>> + if (saved_vm_running) { >>>> + vm_start(); >>>> + } >>>> + timer_mod_ns(snap_timer, snap->time + 100000000); >>>> + } >>>> +} >>>> + >>>> +/* >>>> + * Timer callback called when the VM have to stop. >>>> + */ >>>> +static void stop_callback(void *opaque) { >>>> + trace_stop_callback(qemu_clock_get_ns(QEMU_CLOCK_ICOUNT)); >>>> + cexe_state.stop_requested =3D true; >>>> +} >>>> + >>>> +void cexe_setup(void) >>> Sorry, but, what's the mean of cexe here and there? >> This means "exec" in reverse.. > good! > But seems a little hard to get it. > > Thanks! > >