linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] trace-cmd: Add new API tracecmd_set_merge_peer()
Date: Mon, 13 Apr 2020 10:05:46 +0300	[thread overview]
Message-ID: <CAPpZLN6KDSMbT95EH-PKXTKD7iyJfrA2XHivwWrfKHKP41h60Q@mail.gmail.com> (raw)
In-Reply-To: <20200409210713.6a0fccfa@oasis.local.home>

On Fri, Apr 10, 2020 at 4:07 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Thu,  9 Apr 2020 16:28:34 +0300
> "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
>
> > +/**
> > + * tracecmd_set_merge_peer - Link a tracing peer to this handle
> > + * @handle: input handle for the trace.dat file
> > + * @peer: input handle for the tracing peer
> > + *
> > + * When tracing host and one or more guest machines at the same time,
> > + * guest and host are tracing peers. There is information in both trace
> > + * files, related to host PID to guest vCPU mapping, timestamp synchronization
> > + * and other. This information is useful when opening files at the same time and
> > + * merging the events. When the host is set as a tracing peer to the guest, then
> > + * the timestamps of guest's events are recalculated to match the host event's time
> > + */
> > +int tracecmd_set_merge_peer(struct tracecmd_input *handle,
> > +                         struct tracecmd_input *peer)
>
> I wonder it would be better to call this tracecmd_pair_peer(), like
> pairing a bluetooth headset with your phone?
>
> > +{
> > +     if (!handle)
> > +             return -1;
> > +
>
> This should probably fail if the host.peer_data is already set. Which
> means we should also have a way to unmerge (unpair) the two. Which is
> why I like the term "pair" better, as it is like paring a bluetooth
> device and then unpairing it.
>
> -- Steve
>
>
It makes sense, I'll send the next version with these changes.
Thanks, Steven!

> > +     handle->host.peer_data = peer;
> > +     tracecmd_ref(peer);
> > +     tsync_check_enable(handle);
> > +
> > +     return 0;
> > +}
> > +
> >  /**
> >   * tracecmd_ref - add a reference to the handle
> >   * @handle: input handle for the trace.dat file
> > @@ -3785,7 +3839,7 @@ int tracecmd_get_guest_cpumap(struct tracecmd_input *handle,
> >   */
> >  unsigned long long tracecmd_get_tsync_peer(struct tracecmd_input *handle)
> >  {
> > -     return handle->host.trace_id;
> > +     return handle->host.peer_trace_id;
> >  }
> >



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

  reply	other threads:[~2020-04-13  7:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 13:28 [PATCH 0/2] Useful APIs for merging tracing files Tzvetomir Stoyanov (VMware)
2020-04-09 13:28 ` [PATCH 1/2] trace-cmd: Add new API tracecmd_set_merge_peer() Tzvetomir Stoyanov (VMware)
2020-04-10  1:07   ` Steven Rostedt
2020-04-13  7:05     ` Tzvetomir Stoyanov [this message]
2020-04-09 13:28 ` [PATCH 2/2] trace-cmd: Validate input parameters of tracecmd_get_guest_cpumap() API Tzvetomir Stoyanov (VMware)

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=CAPpZLN6KDSMbT95EH-PKXTKD7iyJfrA2XHivwWrfKHKP41h60Q@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).