On Thu, 23 Sep 2021 12:45:25 +0300 "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > @@ -1235,7 +1236,6 @@ timestamp_correction_calc(unsigned long long ts, unsigned int flags, > struct ts_offset_sample *min, > struct ts_offset_sample *max) > { > - long long scaling; > long long tscor; > > if (flags & TRACECMD_TSYNC_FLAG_INTERPOLATE) { > @@ -1243,15 +1243,12 @@ timestamp_correction_calc(unsigned long long ts, unsigned int flags, > long long offset = ((long long)ts - min->time) * > (max->offset - min->offset); > > - scaling = (min->scaling + max->scaling) / 2; So the max->scaling is not going to play a role here? Does this work for other methods besides KVM? -- Steve > tscor = min->offset + (offset + delta / 2) / delta; > - > } else { > - scaling = min->scaling; > tscor = min->offset; > } > > - ts *= scaling; > + ts = (ts * min->scaling) >> min->fraction; > if (tscor < 0) > return ts - llabs(tscor); > > @@ -2337,37 +2334,16 @@ static int tsync_offset_cmp(const void *a, const void *b) >