linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Giuseppe Eletto <giuseppe.eletto@edu.unito.it>,
	linux-trace-devel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	Enrico Bini <enrico.bini@unito.it>
Subject: Re: A KernelShark plugin for Xen traces analysis
Date: Thu, 15 Apr 2021 02:41:49 +0200	[thread overview]
Message-ID: <6176e02b5b82e9be10351ea386ba2cb8573d7f5b.camel@suse.com> (raw)
In-Reply-To: <f44f994d-32da-0610-57d8-e3a30bbb278c@citrix.com>

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

On Wed, 2021-04-14 at 21:05 +0100, Andrew Cooper wrote:
> On 14/04/2021 14:43, Steven Rostedt wrote:
> > 
> > What I would envision how this would work, is that you would
> > produce a
> > set of tracing files. One for each guest (including Dom0), and one
> > for the
> > Xen hypervisor itself. The trick is to have a way to synchronize
> > the time
> > stamps. What we just did with KVM is to have all the tracing record
> > the
> > CPUs TSC, including the shift and multiplier that the CPU might
> > change for
> > the guests. Then we have a way to convert the TSC to nanoseconds.
> > This way
> > all tracing data has the same clock. It's somewhat complicated to
> > get
> > right, and requires access to how the guests clocks are modified by
> > the CPU.
> 
> Xen certainly has enough information to describe what TSC rate/epoch
> each guest is seeing, but I doubt any of this is coherently exposed
> at
> the moment.
> 
Yeah. In KVM its in, e.g.:

/sys/kernel/debug/kvm/85276-13/vcpu0/tsc-offset

Where 85276-13 is a combination of the PID of the main QEMU process and
one of the KVM file descriptors.

> > The Xen plugin would then need to read the how the threads in
> > xen.dat map
> > to the virtual CPUs of each of the guest files. Which would give
> > you the
> > layering.
> 
> Looks good.  I suspect we might need to do a little work on Xen's
> trace
> data to make this mesh together nicely.  In particular, Xen doesn't
> have
> a terribly good scheme on unique IDs for "a VM".
> 
True. However, Linux recycles PIDs too, doesn't it?

I mean, if PID 1234 is running when I start tracing and it dies and,
after a while, another task with PID 1234 is started KernelShark will
probably treat and display them as if they were the same task? Or
wouldn't it?

Currently, the Xen plugin combines the domain ID and the vCPU ID to
come up with a PID, that then will be used for assigning a color to
each vCPU.

This is pretty much arbitrary and can be changed, but it of course has
to be something that we can extract from from the trace event records
or, at least, from the trace file (e.g., as Andrew said, we do have
per-VM UUIDs, but they're currently not there).

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-04-15  0:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 14:28 A KernelShark plugin for Xen traces analysis ​ Giuseppe Eletto
2021-04-13 15:33 ` Andrew Cooper
2021-04-14 17:31   ` Dario Faggioli
2021-04-14 18:11     ` Andrew Cooper
2021-04-14 19:07       ` A KernelShark plugin for Xen traces analysis Steven Rostedt
2021-04-15  0:50         ` Dario Faggioli
2021-04-15 13:29           ` Steven Rostedt
2021-04-14 21:51       ` A KernelShark plugin for Xen traces analysis ​ Dario Faggioli
2021-04-13 15:46 ` A KernelShark plugin for Xen traces analysis Steven Rostedt
2021-04-14 10:07   ` Andrew Cooper
2021-04-14 13:43     ` Steven Rostedt
2021-04-14 20:05       ` Andrew Cooper
2021-04-15  0:41         ` Dario Faggioli [this message]
2021-04-15  0:13     ` Dario Faggioli
2021-04-14 22:11   ` Dario Faggioli
2021-04-14 22:25     ` Steven Rostedt
2021-04-14  9:25 ` A KernelShark plugin for Xen traces analysis ​ Yordan Karadzhov (VMware)
2021-04-14 17:46   ` Dario Faggioli

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=6176e02b5b82e9be10351ea386ba2cb8573d7f5b.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=enrico.bini@unito.it \
    --cc=giuseppe.eletto@edu.unito.it \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=xen-devel@lists.xenproject.org \
    /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).