diff mbox

[v18,00/21] Deterministic replay core

Message ID 5613E443.90909@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Oct. 6, 2015, 3:09 p.m. UTC
On 21/09/2015 09:12, Pavel Dovgaluk wrote:
> Hi!
> 
> Paolo, have you reviewed these patches?

Pavel,

I think this is ready to go in.  Here are my final changes,
can you ack them?

Thanks,

Paolo

Comments

Igor R Nov. 4, 2015, 10:57 a.m. UTC | #1
Hello,

I would like to try this new functionality. What's the correct way to do
this?

I'm trying the following (after applying the patches to qemu upstream):
qemu-system-i386 mylinux.qcow2 -icount shift=7,rr=record,rrfile=record.bin
-net none

Linux gets booted, record.bin file is created.
Then I quit qemu and start replay with rr=replay. After "booting from hard
disk" message the vm gets stuck.
What am I doing wrong?

Thanks.
diff mbox

Patch

diff --git a/Makefile.objs b/Makefile.objs
index bc43e5c..ba4b45e 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -58,6 +58,8 @@  common-obj-y += audio/
 common-obj-y += hw/
 common-obj-y += accel.o
 
+common-obj-y += replay/
+
 common-obj-y += ui/
 common-obj-y += bt-host.o bt-vhci.o
 bt-host.o-cflags := $(BLUEZ_CFLAGS)
diff --git a/Makefile.target b/Makefile.target
index ca8f351..962d004 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -88,7 +88,6 @@  obj-y = exec.o translate-all.o cpu-exec.o
 obj-y += translate-common.o
 obj-y += cpu-exec-common.o
 obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
-obj-y += replay/
 obj-$(CONFIG_TCG_INTERPRETER) += tci.o
 obj-y += tcg/tcg-common.o
 obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
diff --git a/qemu-timer.c b/qemu-timer.c
index e7a5c96..023d0fa 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -572,15 +572,14 @@  int64_t timerlistgroup_deadline_ns(QEMUTimerListGroup *tlg)
     QEMUClockType type;
     bool play = replay_mode == REPLAY_MODE_PLAY;
     for (type = 0; type < QEMU_CLOCK_MAX; type++) {
-        if (qemu_clock_use_for_deadline(tlg->tl[type]->clock->type)) {
-            if (!play || tlg->tl[type]->clock->type == QEMU_CLOCK_REALTIME) {
+        if (qemu_clock_use_for_deadline(type)) {
+            if (!play || type == QEMU_CLOCK_REALTIME) {
                 deadline = qemu_soonest_timeout(deadline,
-                                                timerlist_deadline_ns(
-                                                    tlg->tl[type]));
+                                                timerlist_deadline_ns(tlg->tl[type]));
             } else {
                 /* Read clock from the replay file and
                    do not calculate the deadline, based on virtual clock. */
-                qemu_clock_get_ns(tlg->tl[type]->clock->type);
+                qemu_clock_get_ns(type);
             }
         }
     }
@@ -606,8 +605,7 @@  int64_t qemu_clock_get_ns(QEMUClockType type)
         now = REPLAY_CLOCK(REPLAY_CLOCK_HOST, get_clock_realtime());
         last = clock->last;
         clock->last = now;
-        if ((now < last || now > (last + get_max_clock_jump()))
-            && replay_mode == REPLAY_MODE_NONE) {
+        if (now < last || now > (last + get_max_clock_jump())) {
             notifier_list_notify(&clock->reset_notifiers, &now);
         }
         return now;
diff --git a/replay/Makefile.objs b/replay/Makefile.objs
index 1267969..186dbcf 100755
--- a/replay/Makefile.objs
+++ b/replay/Makefile.objs
@@ -1,6 +1,6 @@ 
-obj-$(CONFIG_SOFTMMU) += replay.o
-obj-$(CONFIG_SOFTMMU) += replay-internal.o
-obj-$(CONFIG_SOFTMMU) += replay-events.o
-obj-$(CONFIG_SOFTMMU) += replay-time.o
-obj-$(CONFIG_SOFTMMU) += replay-input.o
-obj-$(CONFIG_USER_ONLY) += replay-user.o
+common-obj-$(CONFIG_SOFTMMU) += replay.o
+common-obj-$(CONFIG_SOFTMMU) += replay-internal.o
+common-obj-$(CONFIG_SOFTMMU) += replay-events.o
+common-obj-$(CONFIG_SOFTMMU) += replay-time.o
+common-obj-$(CONFIG_SOFTMMU) += replay-input.o
+common-obj-$(CONFIG_USER_ONLY) += replay-user.o
diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 69fe49f..4b6a83a 100755
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -196,7 +196,7 @@  void replay_save_instructions(void)
     if (replay_file && replay_mode == REPLAY_MODE_RECORD) {
         replay_mutex_lock();
         int diff = (int)(replay_get_current_step() - replay_state.current_step);
-        if (first_cpu != NULL && diff > 0) {
+        if (diff > 0) {
             replay_put_event(EVENT_INSTRUCTION);
             replay_put_dword(diff);
             replay_state.current_step += diff;
diff --git a/stubs/replay.c b/stubs/replay.c
index f7f74c9..a52182d 100755
--- a/stubs/replay.c
+++ b/stubs/replay.c
@@ -21,11 +21,6 @@  bool replay_checkpoint(ReplayCheckpoint checkpoint)
     return 0;
 }
 
-int runstate_is_running(void)
-{
-    return 0;
-}
-
 bool replay_events_enabled(void)
 {
     return false;