mbox series

[v5,0/9,POC] trace-cmd: Timetamps sync between host and guest machines, relying on vsock events.

Message ID 20190308134423.22008-1-tstoyanov@vmware.com (mailing list archive)
Headers show
Series trace-cmd: Timetamps sync between host and guest machines, relying on vsock events. | expand

Message

Tzvetomir Stoyanov March 8, 2019, 1:44 p.m. UTC
[
 V5 changes:
  - Rebased to Slavomir's v8 "Add VM kernel tracing over vsockets and FIFOs"
    patch series.
  - Implemented an algorithm for time drift correction.
  - Addressed Slavomir's commnets.
  - Refactored the code: moved all time sync specific implementation in trace-timesync.c
  - Isolated all hardcoded event specific stuff in a structure, so it could be easily 
    moved to external plugins.
  - Added a check for VSOCK support: do not perform vsock dependent time synchronisation 
    in case there is no VSOCK support. 

 V4 changes:
  - Removed the implementation of PTP-like algorithm. The current 
    logic relies on matching time stamps of kvm_exit/virtio_transport_recv_pkt
    events on host to virtio_transport_alloc_pkt/vp_notify events on guest.
  - Rebased to Slavomir's v7 "Add VM kernel tracing over vsockets and FIFOs" 
    patch series.
  - Decreased the time synch probes from 5000 to 300.
  - Addressed Steven Rostedt comments.
  - Code cleanup. 

 V3 changes:
 - Removed any magic constants, used in the PTP-like algorithm,
   as Slavomir Kaslev suggested.
 - Implemented new algorithm, based on mapping kvm_exit events
   in host context to vsock_send events in guest context,
   suggested by Steven Rostedt.

 V2 changes:
  - Addressed Steven Rostedt comments.
  - Modified PTP-like timestamps sync algorithm to gain more accuracy, with the
    help of Yordan Karadzhov and Slavomir Kaslev.
]


This patch series is a POC for timestamps sync between guest and host machines.
The algorithm relies on matching time stamps of guest and host vsock events.

The patch series depends on Slavomir's changes, introduced by the v8 patch series
"Add VM kernel tracing over vsockets and FIFOs"

Tzvetomir Stoyanov (9):
  trace-cmd: Implemented new lib API: tracecmd_local_events_system()
  trace-cmd: Added support for negative time offsets in trace.dat file
  trace-cmd: Fix tracecmd_read_page_record() to read more than one event
  trace-cmd: Added implementation of htonll() and ntohll()
  trace-cmd: Refactored few functions in trace-record.c
  trace-cmd: Find and store pids of tasks, which run virtual CPUs of
    given VM
  trace-cmd: Implemented new API tracecmd_add_option_v()
  trace-cmd: Implemented new option in trace.dat file:
    TRACECMD_OPTION_TIME_SHIFT
  trace-cmd [POC]: Implemented timestamps synch PTP-like algorithm,
    using vsock events.

 include/trace-cmd/trace-cmd.h    |  19 +-
 include/traceevent/event-parse.h |   1 +
 lib/trace-cmd/trace-input.c      | 137 ++++++-
 lib/trace-cmd/trace-util.c       |  99 +++--
 tracecmd/Makefile                |   1 +
 tracecmd/include/trace-local.h   |  60 +++
 tracecmd/include/trace-msg.h     |  10 +
 tracecmd/trace-msg.c             | 284 +++++++++++++-
 tracecmd/trace-output.c          | 117 +++++-
 tracecmd/trace-read.c            |   4 +-
 tracecmd/trace-record.c          | 227 +++++++++--
 tracecmd/trace-timesync.c        | 622 +++++++++++++++++++++++++++++++
 12 files changed, 1467 insertions(+), 114 deletions(-)
 create mode 100644 tracecmd/trace-timesync.c