linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
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 09:12:05 -0400	[thread overview]
Message-ID: <20210514091205.6b269474@gandalf.local.home> (raw)
In-Reply-To: <CAPpZLN6p2UgghB16=eqpacica6XEOLuCqTds+SdhFbZkPUZ0Hw@mail.gmail.com>

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?

-- Steve

  reply	other threads:[~2021-05-14 13:12 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 [this message]
2021-05-14 13:38       ` Tzvetomir Stoyanov
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=20210514091205.6b269474@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tz.stoyanov@gmail.com \
    /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).