mbox series

[v2,0/3] Fix overflow when applying tsc2nsec calculations

Message ID 20210416103409.24597-1-tz.stoyanov@gmail.com (mailing list archive)
Headers show
Series Fix overflow when applying tsc2nsec calculations | expand

Message

Tzvetomir Stoyanov (VMware) April 16, 2021, 10:34 a.m. UTC
Verify that applying tsc2nsec corrections on the recorded timestamps will not
cause an overflow. When recording the trace, in case of tsc2nsec clock, get
the first TSC timestamp as offset to be used in tsc2nsec conversion.

v2 changes:
 - Optimize the logic for getting the timestamp of the first recorded event.

Tzvetomir Stoyanov (VMware) (3):
  trace-cmd library: Add new trace-cmd library APIs for guest ts
    corrections
  trace-cmd library: Add check before applying tsc2nsec offset
  trace-cmd: Get the timestamp of the first recorded event as TSC offset

 .../include/private/trace-cmd-private.h       |  18 ++-
 lib/trace-cmd/trace-input.c                   | 116 ++-----------
 lib/trace-cmd/trace-timesync.c                | 113 ++++++++++---
 tracecmd/include/trace-local.h                |   1 +
 tracecmd/trace-record.c                       | 152 ++++++++++++++----
 5 files changed, 246 insertions(+), 154 deletions(-)