linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org, joelaf@google.com
Subject: Re: [PATCH] trace-cmd: Add support for non-qemu VMs
Date: Tue, 4 May 2021 17:23:10 -0400	[thread overview]
Message-ID: <20210504172310.5a510ec9@gandalf.local.home> (raw)
In-Reply-To: <20210426103528.634418-1-tz.stoyanov@gmail.com>

On Mon, 26 Apr 2021 13:35:28 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> Current host-guest tracing implementation assumes that qemu runs the VMs
> and uses qemu specific logic to collect various information:
>  - PID of the process, running the guest VM. In case of KVM, this PID
>    is used  to get the KVM guest TSC clock parameters, needed for better
>    host and guest trace timestamps synchronization.
>  - PIDs of each thread, running a guest virtual CPU. This is used for
>    better trace visualisation. It helps to map the host task to a vCPU
>    and to visualise them together.
> In case qemu is not used to run the VMs, host-guest tracing fails. As
> that information is not mandatory, we can easily support non-qemu VMs.
> Changes, proposed by the patch:
>  - if PID of the process, running the guest VM, is not available - fail
>    back to a PTP-like algorithm for trace timestamps synchronization.
>  - if PIDs of the threads, running guest virtual CPUs, are not available
>    write -1 in the trace file metadata.
> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
> ---

We need to fix this for qemu as well. I just upgraded my test box to
Fedora-33 and it renamed qemu from qemu-system-x86 to qemu-kvm, and I hit
the same issue that Joel did with his code. And this patch just removes the
use of KVM synchronization for my box.

I'll try to find other ways to get this information than the hack we
currently have. Relying on the application name is not robust at all. But
unfortunately, there's currently no way that I can find that exports the
CID of tasks. Perhaps this is going to require a kernel change. To have a
netstat functionality for vsockets.

-- Steve

      parent reply	other threads:[~2021-05-04 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 10:35 [PATCH] trace-cmd: Add support for non-qemu VMs Tzvetomir Stoyanov (VMware)
2021-04-26 18:44 ` Joel Fernandes
2021-04-27  1:19   ` Joel Fernandes
2021-04-27  8:27   ` Yordan Karadzhov
2021-04-27 15:34     ` Joel Fernandes
2021-05-04 21:23 ` Steven Rostedt [this message]

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=20210504172310.5a510ec9@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=joelaf@google.com \
    --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).