From: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 3/3] trace-cmd: Get the timestamp of the first recorded event as TSC offset
Date: Fri, 16 Apr 2021 07:41:40 +0300 [thread overview]
Message-ID: <CAPpZLN4m5bPj=Di-UA98dKKpLrL3d4eFiRMQpSSsJ2nnjVJcTg@mail.gmail.com> (raw)
In-Reply-To: <20210415171845.3e6ee0d8@gandalf.local.home>
On Fri, Apr 16, 2021 at 12:18 AM Steven Rostedt <rostedt@goodmis.org> 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
prev parent reply other threads:[~2021-04-16 4:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 8:15 [PATCH 0/3] Fix overflow when applying tsc2nsec calculations Tzvetomir Stoyanov (VMware)
2021-04-15 8:15 ` [PATCH 1/3] trace-cmd library: Add new trace-cmd library APIs for guest ts corrections Tzvetomir Stoyanov (VMware)
2021-04-15 8:15 ` [PATCH] trace-cmd: Suppress trace library warnings Tzvetomir Stoyanov (VMware)
2021-04-15 8:15 ` [PATCH 2/3] trace-cmd library: Add check before applying tsc2nsec offset Tzvetomir Stoyanov (VMware)
2021-04-15 8:15 ` [PATCH 3/3] trace-cmd: Get the timestamp of the first recorded event as TSC offset Tzvetomir Stoyanov (VMware)
2021-04-15 21:18 ` Steven Rostedt
2021-04-15 21:25 ` Steven Rostedt
2021-04-16 4:41 ` Tzvetomir Stoyanov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPpZLN4m5bPj=Di-UA98dKKpLrL3d4eFiRMQpSSsJ2nnjVJcTg@mail.gmail.com' \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).