Re: [PATCH v3 15/23] trace-cmd: Set order and priorities when applying timestamp corrections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 24, 2021 at 8:51 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Wed, 24 Mar 2021 15:04:10 +0200
> "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:
>
> > @@ -1296,15 +1287,23 @@ static unsigned long long timestamp_correct(unsigned long long ts,
> >  static unsigned long long timestamp_calc(unsigned long long ts,
> >                                        struct tracecmd_input *handle)
> >  {
> > -     ts = timestamp_correct(ts, handle);
> > +     /* Guest trace file, sync with host timestamps */
> > +     if (handle->host.sync_enable)
> > +             ts = timestamp_host_sync(ts, handle);
> >
> > -     if (handle->ts2secs)
> > +     if (handle->ts2secs) {
> > +             /* user specified clock frequency */
> >               ts *= handle->ts2secs;
> > -     else if (handle->tsc_calc.mult) {
> > +     } else if (handle->tsc_calc.mult) {
> > +             /* auto calculated TSC clock frequency */
> >               ts -= handle->tsc_calc.offset;
> >               ts = mul_u64_u32_shr(ts, handle->tsc_calc.mult, handle->tsc_calc.shift);
> >       }
> >
> > +     /* User specified time offset with --ts-offset or --date options */
> > +     if (handle->ts_offset)
> > +             ts += handle->ts_offset;
> > +
> >       return ts;
> >  }
>
>
> Now that I'm playing with this, I find I want to see what the result is
> without the tsc_calc.offset, but can't do it. I'm thinking that the
> --ts-offset should modify that instead:
>
>         bool ts_offset_set = false;
>         [..]
>
>         } else if (handel->tsc_calc.mult) {
>                 ts_offset_set = true;
>                 if (handle->ts_offset)
>                         ts += handle->ts_offset;

This will apply user specified offset instead of the autocalculated ?
I think it is better to have an option to disable the whole tsc2sec
adjustment when displaying the file, or just set a custom ts2sec:
     trace-cmd report --ts2secs 1000000000 ...  <- set ts2sec to 1,
this will be applied instead of tsc2nsec.
Or using a combination of "trace-cmd report --ts2secs ... --ts-offset
...", it replaces autocalculated tsc2sec with custom ones.
I think the existing "trace-cmd report" options are flexible enough.


>                 else
>                         ts -= handle->tsc_calc.offset;
>                 [..]
>         }
>
>         if (handle->ts_offset && !ts_offset_set)
>                 ts += handle->ts_offset;
>
> Or should we add another option to modify the ts_calc.offset?
>
> Thoughts?
>
> -- Steve



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



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux