Re: [PATCH] trace-cmd: Find PID of host-guest task from tracing vsock connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 5 May 2021 08:04:57 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>
> 
> Searching for the qemu task to find what task the CID is for is not a
> reliable method, as the qemu executable may be called different names on
> different systems, and qemu may not even be used.
> 
> Instead, trace the sched_waking and kvm_exit events and do a vsock
> connection to the CID. By doing so, you can find the task that runs the
> guest.
> 
>  trace-cmd wakes up "vhost-<pid>"
>  vhost-<pid> wakes up "CPUX/KVM"
>  CPUX/KVM calls "kvm_exit"
> 
> The CPUX/KVM is the task that runs the vCPU of the guest, but we still
> need the task group leader of this task to find the task that KVM has
> for timestamp offsets and multipliers. To do that, look at the proc
> file system for the PID of the CPUX/KVM and read its status file.
> This holds "Tgid:    <pid>" where "<pid>" is the PID of the task that
> has the KVM information.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
> ---
>

Joel,

Can you try this patch out on crosvm and see if it works for that too? It
should (hopefully) find the PID for the main task that it uses to sync with
KVM, and should use the KVM protocol instead of the ptp one.

That's if crosvm works the same as qemu.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux