On 26/06/2014 10:17, lig.f...@cn.fujitsu.com wrote: >> -----邮件原件----- >> 发件人: Frederic Konrad [mailto:fred.kon...@greensocs.com] >> 发送时间: 2014年6月26日 15:28 >> 收件人: Li, Guang/李 广; qemu-devel@nongnu.org >> 抄送: peter.mayd...@linaro.org; quint...@redhat.com; >> mark.bur...@greensocs.com; dgilb...@redhat.com; amit.s...@redhat.com; >> pbonz...@redhat.com; vilan...@ac.upc.edu >> 主题: Re: 答复: [Qemu-devel] [RFC PATCH v5 09/13] introduce reverse >> execution mechanism. >> >> On 26/06/2014 04:31, lig.f...@cn.fujitsu.com wrote: >>> Hi, >> Hi, >> >>>> -----邮件原件----- >>>> 发件人: qemu-devel-bounces+lig.fnst=cn.fujitsu....@nongnu.org >>>> [mailto:qemu-devel-bounces+lig.fnst=cn.fujitsu....@nongnu.org] 代表 >>>> fred.kon...@greensocs.com >>>> 发送时间: 2014年6月25日 23:20 >>>> 收件人: qemu-devel@nongnu.org >>>> 抄送: peter.mayd...@linaro.org; quint...@redhat.com; >>>> mark.bur...@greensocs.com; dgilb...@redhat.com; >> amit.s...@redhat.com; >>>> pbonz...@redhat.com; vilan...@ac.upc.edu; fred.kon...@greensocs.com >>>> 主题: [Qemu-devel] [RFC PATCH v5 09/13] introduce reverse execution >>>> mechanism. >>>> >>>> From: KONRAD Frederic <fred.kon...@greensocs.com> >>>> >>>> This introduces the basic reverse-execution mechanism. >>>> >>>> Signed-off-by: KONRAD Frederic <fred.kon...@greensocs.com> >>>> --- >>>> 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 100644 >>>> include/reverse-execution.h create mode 100644 reverse-execution.c >> [...] >>>> + >>>> +static QLIST_HEAD(, snapshot_entry) snapshot = >>>> +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 = runstate_is_running(); >>>> + vm_stop(RUN_STATE_SAVE_VM); >>>> + snap->time = 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 = 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 = 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! > >