All of lore.kernel.org
 help / color / mirror / Atom feed
* Multiple time offsets in trace.dat file
@ 2019-02-25 15:37 Tzvetomir Stoyanov
  2019-02-25 17:11 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Tzvetomir Stoyanov @ 2019-02-25 15:37 UTC (permalink / raw)
  To: Steven Rostedt, linux-trace-devel

Hi Steven,
When tracing host and guest machines, in order to overcome the drift
between the times in both contexts, we need to use multiple (at least
2) time offsets. In addition, we need the local time stamp, related to
each offset:
  (ts_offset1, ts_local1), (ts_offset2, ts_local2), ....
 where ts_local1 is the time when the offset ts_offset1 was measured.
This information should be stored somehow in trace.dat file, which
currently supports only one TRACECMD_OPTION_OFFSET option.
There are two possible approaches to do it, please suggest which one to choose:

 1. Use the existing TRACECMD_OPTION_OFFSET, written 2 times in the
trace.dat file. Extract the ts_local1 and ts_local2 times from the
file, as ts_local1 is the time of the first event and ts_local2 is the
time of the last event. There are few  cons of this approach:
        - we can use only 2 offsets, before and after the trace.
        - mapping ts_local1 and ts_local2 to the times of the first
and last event is not accurate, as these are not the actual times when
the time stamps were calculated.
         - Finding first and last event from the trace.dat file will
require one extra parsing of the whole file, as the events there are
not sorted.

 2. Introduce a new TRACECMD_OPTION_ option, which will hold all
ts_offsets together with ts_local times.

-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Multiple time offsets in trace.dat file
  2019-02-25 15:37 Multiple time offsets in trace.dat file Tzvetomir Stoyanov
@ 2019-02-25 17:11 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2019-02-25 17:11 UTC (permalink / raw)
  To: Tzvetomir Stoyanov; +Cc: linux-trace-devel

On Mon, 25 Feb 2019 15:37:57 +0000
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> Hi Steven,
> When tracing host and guest machines, in order to overcome the drift
> between the times in both contexts, we need to use multiple (at least
> 2) time offsets. In addition, we need the local time stamp, related to
> each offset:
>   (ts_offset1, ts_local1), (ts_offset2, ts_local2), ....
>  where ts_local1 is the time when the offset ts_offset1 was measured.
> This information should be stored somehow in trace.dat file, which
> currently supports only one TRACECMD_OPTION_OFFSET option.
> There are two possible approaches to do it, please suggest which one to choose:
> 
>  1. Use the existing TRACECMD_OPTION_OFFSET, written 2 times in the
> trace.dat file. Extract the ts_local1 and ts_local2 times from the
> file, as ts_local1 is the time of the first event and ts_local2 is the
> time of the last event. There are few  cons of this approach:
>         - we can use only 2 offsets, before and after the trace.
>         - mapping ts_local1 and ts_local2 to the times of the first
> and last event is not accurate, as these are not the actual times when
> the time stamps were calculated.
>          - Finding first and last event from the trace.dat file will
> require one extra parsing of the whole file, as the events there are
> not sorted.
> 
>  2. Introduce a new TRACECMD_OPTION_ option, which will hold all
> ts_offsets together with ts_local times.
> 

Option 2 is the right approach. The offset is just for the --date
operation by itself. This should be something new, and for older
trace-cmd reading this file, it can simply ignore it.

What about: TRACECMD_OPTION_TIME_SHIFT

does that sound good? I'm open for other suggestions.

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-25 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 15:37 Multiple time offsets in trace.dat file Tzvetomir Stoyanov
2019-02-25 17:11 ` Steven Rostedt

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.