On Fri, 2021-05-07 at 07:58 -0400, Steven Rostedt wrote: > On Fri, 7 May 2021 07:20:15 +0300 > Tzvetomir Stoyanov 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/ ------------------------------------------------------------------- <> (Raistlin Majere)