linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH v2] trace-cmd: Find PID of host-guest task from tracing vsock connection
Date: Fri, 07 May 2021 14:48:25 +0200	[thread overview]
Message-ID: <098a7c9a4af4c0e6364a29eeacbd74a7505f61c0.camel@suse.com> (raw)
In-Reply-To: <20210507075834.43497e77@gandalf.local.home>

[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]

On Fri, 2021-05-07 at 07:58 -0400, Steven Rostedt wrote:
> On Fri, 7 May 2021 07:20:15 +0300
> Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:
> > 
> 
> > Doesn't a VMExit always happen in the thread that runs the vCPU
> > anyway?
> 
> The problem is that we do not know what Tgid we are looking for. If
> you
> have 10 guests, you have 10 different Tgid's that are running those
> guests.
> How do you know which guest is attached to the cid you are looking
> for?
> There's currently no way to find that mapping. 
>
Yes, it is true that this part is missing. I have, like, a thought in
the back of my head that this may be doable in some way, but I can't
actually come up with a working solution!

What prompted my question was the fact that I was not understanding the
focus on this side of the issue, when we had no link to the CID anyway.
And that because...

> In fact, that's why I posted
> this patch:
>       
> https://lore.kernel.org/kvm/20210505163855.32dad8e7@gandalf.local.home/
> 
... I had missed this patch. :-)

> So you trace the kvm exit, and all 10 guests were active at that
> time, and
> you have 100 threads that called kvm exit. Now how do you find the
> pid of
> the task that owns the cid you are looking for, especially if each
> guest
> has their own cid?
> 
Yeah, as said, I see it now.

> Oh, and the guest is run by a fork of qemu that has some other name!
> So you
> can not rely on looking at the thread's cmdline.
> 
Yeah, that probably depends where you look. Plus, we know don't want to
rely on QEMU doing things in a specific way.

> Again, how else can you map the cid to the guest thread? That's the
> missing
> link that following the wake ups give you.
> 
Yep, understood. And despite that weird feeling that there may be
other/simpler ways, I can't name any, so we should go ahead with this
approach I guess. :-)

Thanks for taking the time to explain it, and sorry for the noise. :-D

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-05-07 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 21:14 [PATCH v2] trace-cmd: Find PID of host-guest task from tracing vsock connection Steven Rostedt
2021-05-07  0:32 ` Dario Faggioli
2021-05-07  1:40   ` Steven Rostedt
2021-05-07  4:20     ` Tzvetomir Stoyanov
2021-05-07 11:58       ` Steven Rostedt
2021-05-07 12:48         ` Dario Faggioli [this message]
2021-05-07 13:13           ` 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=098a7c9a4af4c0e6364a29eeacbd74a7505f61c0.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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).