On Tue, Mar 19, 2019 at 5:56 PM Tzvetomir Stoyanov <tstoyanov@xxxxxxxxxx> wrote: > > The TRACECMD_OPTION_TIME_SHIFT is used when synchronizing trace time stamps between > two trace.dat files. It contains multiple long long (time, offset) pairs, describing > time stamps _offset_, measured in the given local _time_. The content of the option > buffer is: > first 4 bytes - integer, count of timestamp offsets > long long array of size _count_, local time in which the offset is measured > long long array of size _count_, offset of the time stamps > > Signed-off-by: Tzvetomir Stoyanov <tstoyanov@xxxxxxxxxx> > --- > include/trace-cmd/trace-cmd.h | 1 + > lib/trace-cmd/trace-input.c | 127 +++++++++++++++++++++++++++++++++- > 2 files changed, 126 insertions(+), 2 deletions(-) > > diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h > index f7c043a..5552396 100644 > --- a/include/trace-cmd/trace-cmd.h > +++ b/include/trace-cmd/trace-cmd.h > @@ -82,6 +82,7 @@ enum { > TRACECMD_OPTION_HOOK, > TRACECMD_OPTION_OFFSET, > TRACECMD_OPTION_CPUCOUNT, > + TRACECMD_OPTION_TIME_SHIFT, > }; > > enum { > diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c > index 0a6e820..04f222d 100644 > --- a/lib/trace-cmd/trace-input.c > +++ b/lib/trace-cmd/trace-input.c > @@ -75,6 +75,11 @@ struct input_buffer_instance { > size_t offset; > }; > > +struct ts_offset_sample { > + long long time; > + long long offset; > +}; > + > struct tracecmd_input { > struct tep_handle *pevent; > struct tep_plugin_list *plugin_list; > @@ -92,6 +97,8 @@ struct tracecmd_input { > bool use_pipe; > struct cpu_data *cpu_data; > long long ts_offset; > + int ts_corr_count; > + struct ts_offset_sample *ts_corr; Nit: ts_corr_count -> ts_samples_count ts_corr -> ts_samples