Re: [PATCH 3/3] trace-cmd: Get the timestamp of the first recorded event as TSC offset

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

 



On Fri, Apr 16, 2021 at 12:18 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
[...]
> >  static void record_data(struct common_record_context *ctx)
> > @@ -4231,9 +4306,18 @@ static void record_data(struct common_record_context *ctx)
> >       char **temp_files;
> >       int i;
> >
> > +     if (ctx->tsc2nsec.mult) {
> > +             for_all_instances(instance) {
> > +                     get_first_ts_instance(instance);
>
> Should check the return code, and at least warn if it fails. As it is done
> after the recording, we don't want to die. But at least let the user know
> something went wrong.
>
> -- Steve
>
> > +                     if (instance->first_ts &&

I'll add return code and will check it instead of that
"instance->first_ts". Failing to get the first ts could be a normal
case, if there are no events recorded in that instance.

> > +                         (!ctx->tsc2nsec.offset || ctx->tsc2nsec.offset > instance->first_ts))
> > +                             ctx->tsc2nsec.offset = instance->first_ts;
> > +             }
> > +     }
> > +
> >       for_all_instances(instance) {
> >               if (is_guest(instance))
> > -                     write_guest_file(instance);
> > +                     write_guest_file(ctx, instance);
> >               else if (host && instance->msg_handle)
> >                       finish_network(instance->msg_handle);
> >               else
>


-- 
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