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

Re: A KernelShark plugin for Xen traces analysis ​


  • To: Giuseppe Eletto <giuseppe.eletto@xxxxxxxxxxxx>, <linux-trace-devel@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 13 Apr 2021 16:33:50 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RS8r+hepWGJ0AWzCrrQfGIXP4pggmogp0/DOnbnhPbU=; b=RvY8l/SvKRXDvr4pLzy5rJbbA4VkmZbdusXcQMFJ43lpDRA1iUi9ehhwNkRW09XsbFYKViHZEMkqGavM8jGG3np4Xc+13LYLC0M9B00m7uYfBUaYKHWEvCm1VZ0eFZoki1Et6CZCjlMcoWZ3kZlY3TOnE+atDpFNoHS+gNDuXobVSI/shI0SFNiLDAkqYAqo3SWqH3S/nGvPYHOcQYD2CSbhjv9DHWNigN4b2jq88lStjjxKm3dmlja9mZlNEvYU0d56Hhpj+vJCv/BNIBKC+glcsOrP/p0ey9mVkdEuFo1NdoTRPmwSyE/D1PUhvP50RxUhvAe5fQTSKDse/v89CA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=azngMtQMfqvf41MhFRRM/ov4sbYud2k9POptzkPBcI+p3aowjFpgS7QjSz5/6aKNF5uhrjX1gQ4oWdmR52dDblmvcQvXl0T5gnDi0t5xiOB3bp5SwKLCuIJcc2VxuzIZ5Wd6V5txZmLmdPyyeRqrfP9ObSHGWZh6J+X9G28JPhlpgjnWfAxw1Uck3NglofTK+vqIzKtknC1kaVneosSxU5olPlQXFpV/Ev16VhKWvs9gs3/GzsTyVzQATW5IVlTeEOrvC2CTuH5hDFEWCwSWX9T2W5kE6wvX1fmitnwGi+RbaQyoFMEujjtZeHYLM2cpZhF9+BIAoIIavENjqkYO3g==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Dario Faggioli <dfaggioli@xxxxxxxx>, Enrico Bini <enrico.bini@xxxxxxxx>
  • Delivery-date: Tue, 13 Apr 2021 15:34:11 +0000
  • Ironport-hdrordr: A9a23:HZoeN6+egRj/3K368iNuk+EccL1zdoIgy1knxilNYDRvWIixi9 2ukPMH1RX9lTYWXzUalcqdPbSbKEmwybdc2qNUGbu5RgHptC+TLI9k5Zb/2DGIIUfD38Zn/+ Nbf6B6YeeaMXFTh8z3+RT9Nt4mzsWO/qzAv5a5815GZ2hRC51IxQF/FwqdDwlSTA5JGZI2GP Onl7N6jhCnfmkaadn+O2kdU4H41pT2vb/vfBJuPW9C1CCgljWtgYSVLzG9/jMzFwxC2q0j92 +tqX2w2oyGv+ugwhHRk0//hq4m/+fJ8ddICMyShsV9EFyF5mmVTb58UL6Pti1dmpDN1H8Wkc LBqxplH8N/52K5RBDRnTLR2hLt2Dtr1nn6yVXwuwqAneXFQlsBavZptMZ8SF/0+kAgtNZz3O ZgxGSCradaChvGgWDU+8XIfwsCrDv/nVMS1cooy1BPW4oXb7Fc6aYF+llOLZsGFCXmrKg6De hVCt3G7vo+SyLWU1np+k1UhPC8VHU6GRmLBmIYvNaO7jRQlHdli2wV2dIYhXVF0J4mUZFL66 DlP81T5f1zZ/5TSZg4KPYKQMOxBGCIawnLKniuLVPuE7xCNGnKr5Lx/bUp9OCncJEF1/IJ6d r8eWIdkVR3V1PlCMWI0pEO2AvKWn+BUTPkzdwb55URgMy8eJPbdQm4DHw+mcqppPsSRufBXe yoBZ5QC/j/aW/nGYND2RziS4BfQENuEPE9i5IeYRajs8jLIorluqjw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ylF5ruGbCqyzZKdVGZw26IHTwHxjco3vryTR2dDsXk3UGOjtouAACriRpW1Cgeuza7N lfA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13/04/2021 15:28, Giuseppe Eletto wrote:
> Hello,
> I want to share with you a new plugin developed by me, under the
> supervision of Dario Faggioli, which allows the new version of KernelShark
> (the v2-beta) to open and view the Xen traces created using the "xentrace" 
> tool.
>
> In fact, KernelShark is a well known tool for graphical visualization
> Linux kernel traces, obtained via "ftrace" and "trace-cmd". Anyway thanks
> to its modular architecture, it is now possible to implement plugins which
> open and display traces with arbitrary format, for example, as in in
> this case, traces of the Xen hypervisor.
>
> For more information on how to build the plugin and/or
> to view the source code I leave the repository below:
> https://github.com/giuseppe998e/kernelshark-xentrace-plugin
>
>
> In short:
>
> $ sudo apt install git build-essential libjson-c-dev
> $ git clone --recurse-submodules
> https://github.com/giuseppe998e/kernelshark-xentrace-plugin.git
> $ cd kernelshark-xentrace-plugin/
> $ make
>
> $ export XEN_CPUHZ=3G # Sets the CPU frequency ((G)hz/(M)hz/(K)hz/hz)
> $ kernelshark -p out/ks-xentrace.so trace.xen
>
>
> You will need the development version of KernelShark, available here:
> https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git
>
> A screenshot of the plugin in action is available here:
> https://github.com/giuseppe998e/kernelshark-xentrace-plugin/raw/master/.github/img/ks-xentrace.png
>
> I'm happy to receive whatever feedback you may have about it,
> and to answer any question.

Very nice.

A couple of questions.  Which Xen libraries do you currently use map the
frames?

There is a bug which prevents the mapping being usable in a PVH Dom0,
and I was proposing fixing it by switching to the Acquire Resource
interfaces.  A bonus of doing this is that it can be implemented on
exclusively stable hypercall interfaces, meaning that the plugin no
longer needs recompiling when you change the hypervisor.

To others on xen-devel, do we have firm statement on whether the trace
format itself is stable or not?  I think we've be somewhat nondescript
on this point in the past.

For the screenshot, there are a lot of examples where you have a
dom:vcpu pair, and a number rendered in hex.  Throughout the hypervisor,
we're standardising on d$v$ as a format, and e.g. d[IDLE]v$ for some of
the magic domid's (0x7ff0 ... 0x7fff).

~Andrew




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.