[Spice-devel] [RfC 0/4] add record and replay at device level

Alon Levy alevy at redhat.com
Fri Jul 1 19:49:41 PDT 2011


Add logging of command ring and QXLWorker commands (i.e. dispatcher)
to a file, and replay of same. See individual patches for link to
an example saved file and usage of replay utility.

Lately there has been a renewed interest in trying to improve the
protocol bandwidth, the cpu and memory usage. This is meant as a first
step in that direction by enabling the following workflow:

 record a session. (a vm doing some stuff)
 repeat:
  change something
  run playback
  compare

RfC mainly because:
 1. record/replay implementation - any comments (besides ugly copy of red_parse_qxl)
 2. any objectsions to put this into the code base as is? no #ifdef magic, it adds
  a single if for every command read if unused, and adds some unused code to
  libspice-server.so (red_replay_qxl.c in particular is only used by qxl.c
 3. still has some bugs:
  recording is not stoped nicely, if qemu goes to sleep it doesn't close the
  recorded file nor is it guranteed not to be in the middle of writing.
  This has not prevented me from making a recording
 4. still need some cut utility to be truly useful (to create a part of
  just moving windows for instance, or just cut boot / shutdown stages).
 5. not tested with more then one qxl.

Alon Levy (4):
  server/red_worker: explicitly include unistd and errno
  server/red_{record,replay}.[ch]: introduce
  server/red_worker: record to SPICE_WORKER_RECORD_FILENAME
  server/tests/replay: introduce

 server/Makefile.am              |    2 +
 server/make_recorder.sh         |   13 +
 server/red_record_qxl.c         |  715 ++++++++++++++++++++++++++++++++
 server/red_record_qxl.h         |   44 ++
 server/red_replay_qxl.c         |  849 +++++++++++++++++++++++++++++++++++++++
 server/red_replay_qxl.h         |   23 +
 server/red_worker.c             |   63 +++
 server/red_worker.h             |    2 +
 server/tests/Makefile.am        |    4 +-
 server/tests/basic_event_loop.c |    1 -
 server/tests/replay.c           |  281 +++++++++++++
 11 files changed, 1995 insertions(+), 2 deletions(-)
 create mode 100755 server/make_recorder.sh
 create mode 100644 server/red_record_qxl.c
 create mode 100644 server/red_record_qxl.h
 create mode 100644 server/red_replay_qxl.c
 create mode 100644 server/red_replay_qxl.h
 create mode 100644 server/tests/replay.c

-- 
1.7.5.4



More information about the Spice-devel mailing list