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 <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] trace-cmd: Trace timesync to find pids that map vCPUs
Date: Fri, 14 May 2021 16:38:29 +0300	[thread overview]
Message-ID: <CAPpZLN6cBt6aqL1QP9KxC1e8DqB8DWTVeT=5weF6guOvmdM7vQ@mail.gmail.com> (raw)
In-Reply-To: <20210514091205.6b269474@gandalf.local.home>

On Fri, May 14, 2021, 16:12 Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Fri, 14 May 2021 07:10:51 +0300
> Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:
>
> > > @@ -3250,10 +3282,18 @@ static char *parse_guest_name(char *gname, int *cid, int *port)
> > >         } else if (is_digits(gname))
> > >                 *cid = atoi(gname);
> > >
> > > -       read_qemu_guests();
> > > +       if (*cid < 0)
> > > +               read_qemu_guests();
> > > +
> > > +       if (*cid < 0)
> > > +               return NULL;
> >
> > This check is not needed. If cid is not part of the string, let
> > read_qemu_guests() to try discover the VMs, instead of returning NULL.
>
> I'm confused. That's basically what the above does.
>
>         *cid = -1;
>
>         if (<cid is in name>) {
>                 *cid = look_for_cid_via_tracing();
>         }
>
>         if (*cid < -1)
>                 read_qemu_guests();
>
> That is, if the cid isn't part of the name, then it will call
> read_qemu_guests().
>
> The second check is in case the read_qemu_guests() fails to find the cid
> either.
>
> What am I missing?

cid is not updated between both checks, it always fails - even though
read_qemu_guests() may succeed to find the VM with that name.

>
> -- Steve

  reply	other threads:[~2021-05-14 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 20:43 [PATCH v3 0/2] trace-cmd: Use vsock tracing to find cids and threads Steven Rostedt
2021-05-13 20:43 ` [PATCH v3 1/2] trace-cmd: Find PID of host-guest task from tracing vsock connection Steven Rostedt
2021-05-13 20:43 ` [PATCH v3 2/2] trace-cmd: Trace timesync to find pids that map vCPUs Steven Rostedt
2021-05-14  4:10   ` Tzvetomir Stoyanov
2021-05-14 13:12     ` Steven Rostedt
2021-05-14 13:38       ` Tzvetomir Stoyanov [this message]
2021-05-14 14:00         ` Steven Rostedt

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='CAPpZLN6cBt6aqL1QP9KxC1e8DqB8DWTVeT=5weF6guOvmdM7vQ@mail.gmail.com' \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --subject='Re: [PATCH v3 2/2] trace-cmd: Trace timesync to find pids that map vCPUs' \
    /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

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