All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>,
	Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Subject: [Qemu-devel] [PULL 68/69] replay: update documentation
Date: Tue, 13 Mar 2018 23:47:18 +0100	[thread overview]
Message-ID: <20180313224719.4954-69-pbonzini@redhat.com> (raw)
In-Reply-To: <20180313224719.4954-1-pbonzini@redhat.com>

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch clarifies the description of the record/replay feature
in docs/replay.txt

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20180227095333.1060.1331.stgit@pasha-VirtualBox>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 docs/replay.txt | 72 +++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 52 insertions(+), 20 deletions(-)

diff --git a/docs/replay.txt b/docs/replay.txt
index 959633e7ea..2e21e9ccb0 100644
--- a/docs/replay.txt
+++ b/docs/replay.txt
@@ -7,14 +7,10 @@ See the COPYING file in the top-level directory.
 Record/replay
 -------------
 
-Record/replay functions are used for the reverse execution and deterministic
-replay of qemu execution. This implementation of deterministic replay can
-be used for deterministic debugging of guest code through a gdb remote
-interface.
-
+Record/replay functions are used for the deterministic replay of qemu execution.
 Execution recording writes a non-deterministic events log, which can be later
 used for replaying the execution anywhere and for unlimited number of times.
-It also supports checkpointing for faster rewinding during reverse debugging.
+It also supports checkpointing for faster rewind to the specific replay moment.
 Execution replaying reads the log and replays all non-deterministic events
 including external input, hardware clocks, and interrupts.
 
@@ -28,16 +24,36 @@ Deterministic replay has the following features:
    input devices.
 
 Usage of the record/replay:
- * First, record the execution, by adding the following arguments to the command line:
-   '-icount shift=7,rr=record,rrfile=replay.bin -net none'.
-   Block devices' images are not actually changed in the recording mode,
+ * First, record the execution with the following command line:
+    qemu-system-i386 \
+     -icount shift=7,rr=record,rrfile=replay.bin \
+     -drive file=disk.qcow2,if=none,id=img-direct \
+     -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \
+     -device ide-hd,drive=img-blkreplay \
+     -netdev user,id=net1 -device rtl8139,netdev=net1 \
+     -object filter-replay,id=replay,netdev=net1
+ * After recording, you can replay it by using another command line:
+    qemu-system-i386 \
+     -icount shift=7,rr=replay,rrfile=replay.bin \
+     -drive file=disk.qcow2,if=none,id=img-direct \
+     -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \
+     -device ide-hd,drive=img-blkreplay \
+     -netdev user,id=net1 -device rtl8139,netdev=net1 \
+     -object filter-replay,id=replay,netdev=net1
+   The only difference with recording is changing the rr option
+   from record to replay.
+ * Block device images are not actually changed in the recording mode,
    because all of the changes are written to the temporary overlay file.
- * Then you can replay it by using another command
-   line option: '-icount shift=7,rr=replay,rrfile=replay.bin -net none'
- * '-net none' option should also be specified if network replay patches
-   are not applied.
-
-Papers with description of deterministic replay implementation:
+   This behavior is enabled by using blkreplay driver. It should be used
+   for every enabled block device, as described in 'Block devices' section.
+ * '-net none' option should be specified when network is not used,
+   because QEMU adds network card by default. When network is needed,
+   it should be configured explicitly with replay filter, as described
+   in 'Network devices' section.
+ * Interaction with audio devices and serial ports are recorded and replayed
+   automatically when such devices are enabled.
+
+Academic papers with description of deterministic replay implementation:
 http://www.computer.org/csdl/proceedings/csmr/2012/4666/00/4666a553-abs.html
 http://dl.acm.org/citation.cfm?id=2786805.2803179
 
@@ -46,8 +62,11 @@ Modifications of qemu include:
  * saving different asynchronous events (e.g. system shutdown) into the log
  * synchronization of the bottom halves execution
  * synchronization of the threads from thread pool
- * recording/replaying user input (mouse and keyboard)
+ * recording/replaying user input (mouse, keyboard, and microphone)
  * adding internal checkpoints for cpu and io synchronization
+ * network filter for recording and replaying the packets
+ * block driver for making block layer deterministic
+ * serial port input record and replay
 
 Locking and thread synchronisation
 ----------------------------------
@@ -77,12 +96,11 @@ Non-deterministic events
 Our record/replay system is based on saving and replaying non-deterministic
 events (e.g. keyboard input) and simulating deterministic ones (e.g. reading
 from HDD or memory of the VM). Saving only non-deterministic events makes
-log file smaller, simulation faster, and allows using reverse debugging even
-for realtime applications.
+log file smaller and simulation faster.
 
 The following non-deterministic data from peripheral devices is saved into
 the log: mouse and keyboard input, network packets, audio controller input,
-USB packets, serial port input, and hardware clocks (they are non-deterministic
+serial port input, and hardware clocks (they are non-deterministic
 too, because their values are taken from the host machine). Inputs from
 simulated hardware, memory of VM, software interrupts, and execution of
 instructions are not saved into the log, because they are deterministic and
@@ -205,7 +223,7 @@ Block devices record/replay module intercepts calls of
 bdrv coroutine functions at the top of block drivers stack.
 To record and replay block operations the drive must be configured
 as following:
- -drive file=disk.qcow,if=none,id=img-direct
+ -drive file=disk.qcow2,if=none,id=img-direct
  -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
  -device ide-hd,drive=img-blkreplay
 
@@ -234,6 +252,12 @@ This snapshot is created at start of recording and restored at start
 of replaying. It also can be loaded while replaying to roll back
 the execution.
 
+Use QEMU monitor to create additional snapshots. 'savevm <name>' command
+created the snapshot and 'loadvm <name>' restores it. To prevent corruption
+of the original disk image, use overlay files linked to the original images.
+Therefore all new snapshots (including the starting one) will be saved in
+overlays and the original image remains unchanged.
+
 Network devices
 ---------------
 
@@ -255,6 +279,14 @@ Audio data is recorded and replay automatically. The command line for recording
 and replaying must contain identical specifications of audio hardware, e.g.:
  -soundhw ac97
 
+Serial ports
+------------
+
+Serial ports input is recorded and replay automatically. The command lines
+for recording and replaying must contain identical number of ports in record
+and replay modes, but their backends may differ.
+E.g., '-serial stdio' in record mode, and '-serial null' in replay mode.
+
 Replay log format
 -----------------
 
-- 
2.14.3

  parent reply	other threads:[~2018-03-13 22:48 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 22:46 [Qemu-devel] [PULL 00/69] Misc patches for QEMU soft freeze Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 01/69] qom: introduce object_class_get_list_sorted Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 02/69] net: allow using any PCI NICs in -net or -nic Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 03/69] q35: change default NIC to e1000e Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 04/69] scsi-disk.c: consider bl->max_transfer in INQUIRY emulation Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 05/69] qemu-doc: update deprecation section to use -nic and -netdev hubport Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 06/69] qemu-doc: Add the paragraph about the -no-frame deprecation again Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 07/69] build-sys: make help could have 'modules' target Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 08/69] hw: Do not include "sysemu/block-backend.h" if it is not necessary Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 09/69] checkpatch: Exempt long URLs Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 10/69] vl: export machine_init_done Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 11/69] chardev: fix handling of EAGAIN for TCP chardev Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 12/69] chardev: update net listener gcontext Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 13/69] chardev: allow telnet gsource to switch gcontext Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 14/69] chardev: introduce chr_machine_done hook Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 15/69] chardev: use chardev's gcontext for async connect Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 16/69] chardev: tcp: postpone async connection setup Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 17/69] chardev: tcp: let TLS run on chardev context Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 18/69] scsi: support NDOB (no data-out buffer) for WRITE SAME commands Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 19/69] hw/i386: make IOMMUs configurable via default-configs/ Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 20/69] Polish the version strings containing the package version Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 21/69] hw/mips/jazz: Fix implicit creation of "-drive if=scsi" devices Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 22/69] rcutorture: remove synchronize_rcu from readers Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 23/69] docs: document atomic_load_acquire and atomic_store_release Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 24/69] rcu: make memory barriers more explicit Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 25/69] membarrier: introduce qemu/sys_membarrier.h Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 26/69] membarrier: add --enable-membarrier Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 27/69] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 28/69] hw/dma/i8257: Rename DMA_init() to i8257_dma_init() Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 29/69] hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 30/69] MAINTAINERS: Fix the PC87312 include path Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 31/69] hw/isa/pc87312: Rename the device type as TYPE_PC87312_SUPERIO Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 32/69] hw/isa/pc87312: Use uint16_t for the ISA I/O base address Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 33/69] hw/isa/pc87312: Use 'unsigned int' for the irq value Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 34/69] hw/isa/superio: Add a Super I/O template based on the PC87312 device Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 35/69] hw/isa/pc87312: Inherit from the abstract TYPE_ISA_SUPERIO Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 36/69] hw/isa/superio: Factor out the parallel code from pc87312.c Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 37/69] hw/isa/superio: Factor out the serial " Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 38/69] hw/isa/superio: Factor out the floppy disc controller " Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 39/69] hw/isa/superio: Add a keyboard/mouse controller (8042) Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 40/69] hw/isa/superio: Factor out the IDE code from pc87312.c Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 41/69] hw/mips/malta: Code movement Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 42/69] hw/isa/superio: Factor out the FDC37M817 Super I/O from mips_malta.c Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 43/69] hw/mips/mips_fulong2e: Factor out vt82c686b_southbridge_init() Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 44/69] hw/isa/vt82c686: Rename vt82c686b_init() -> vt82c686b_isa_init() Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 45/69] hw/isa/vt82c686: Add the TYPE_VT82C686B_SUPERIO Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 46/69] MAINTAINERS: Add entries for the VT82C686B Super I/O Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 47/69] MAINTAINERS: Split the Alpha TCG/machine section Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 48/69] hw/isa/superio: Add the SMC FDC37C669 Super I/O Paolo Bonzini
2018-03-13 22:46 ` [Qemu-devel] [PULL 49/69] hw/alpha/dp264: Add the ISA DMA controller Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 50/69] hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO Paolo Bonzini
2018-06-01 18:51   ` Emilio G. Cota
2018-06-01 19:49     ` Richard Henderson
2018-06-13 16:21     ` Paolo Bonzini
2018-06-13 16:35       ` Philippe Mathieu-Daudé
2018-06-13 17:17         ` Philippe Mathieu-Daudé
2018-06-14 12:21           ` Philippe Mathieu-Daudé
2018-03-13 22:47 ` [Qemu-devel] [PULL 51/69] hw/i386/pc: Factor out the superio code Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 52/69] cpu-exec: fix exception_index handling Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 53/69] replay: fix processing async events Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 54/69] replay: fixed replay_enable_events Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 55/69] replay: fix save/load vm for non-empty queue Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 56/69] replay: added replay log format description Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 57/69] replay: save prior value of the host clock Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 58/69] replay/replay.c: bump REPLAY_VERSION again Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 59/69] replay/replay-internal.c: track holding of replay_lock Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 60/69] replay: make locking visible outside replay code Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 61/69] replay: don't destroy mutex at exit Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 62/69] replay: push replay_mutex_lock up the call tree Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 63/69] replay: check return values of fwrite Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 64/69] replay: avoid recursive call of checkpoints Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 65/69] scripts/replay-dump.py: replay log dumper Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 66/69] replay: don't process async events when warping the clock Paolo Bonzini
2018-03-13 22:47 ` [Qemu-devel] [PULL 67/69] replay: save vmstate of the asynchronous events Paolo Bonzini
2018-03-13 22:47 ` Paolo Bonzini [this message]
2018-03-13 22:47 ` [Qemu-devel] [PULL 69/69] tcg: fix cpu_io_recompile Paolo Bonzini
2018-03-14  0:15 ` [Qemu-devel] [PULL 00/69] Misc patches for QEMU soft freeze no-reply
2018-03-14  3:35   ` Peter Xu
2018-03-14 10:12     ` Paolo Bonzini
2018-03-14 11:30       ` Eric Blake
2018-03-14 11:36         ` Peter Xu
2018-03-14 11:53         ` Paolo Bonzini
2018-03-16 12:58 ` Peter Maydell

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=20180313224719.4954-69-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.