All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Peer Adelt <peer.adelt@c-lab.de>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	kbastian@mail.upb.de, "QEMU Developers" <qemu-devel@nongnu.org>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>
Subject: Re: [Qemu-devel] [RFC PATCH 0/3] (Resend) TranslationBlock annotation mechanism
Date: Mon, 25 Jan 2016 13:54:35 +0000	[thread overview]
Message-ID: <CAFEAcA8-7ZHaT0yw=aAn2Ewv72PLQnXkXBMNSxL1V2mFepa3Uw@mail.gmail.com> (raw)
In-Reply-To: <1452768923-13787-1-git-send-email-peer.adelt@c-lab.de>

On 14 January 2016 at 10:55, Peer Adelt <peer.adelt@c-lab.de> wrote:
> We have developed a generic concept to annotate TranslationBlocks during
> runtime. The initial idea was to use it for time annotation with data from
> static analysis tools. However, we have kept this approach as generic as
> possible to allow other kinds of annotation (e.g. power consumption, etc.).
>
> Our extension expects an XML file specifying the CFG of the program (similar
> to what you get from "gcc -ftree-dump-cfg")

(Do you mean -fdump-tree-cfg? But that gives rather different output format.)

> , where the edges are annotated
> with the data, that QEMU ought to accumulate during program execution. Each
> edge has a source and target context in which it is executed.
> For example: a for-loop that runs several times has its own context dependent
> edge for each iteration. We plan on making this more flexible by allowing
> to specify iterative context edges, i.e. from context n to context n+1.
>
> This approach is not limited to one target architecture but we only tested
> it for ARM and TriCore so far.
>
> To show the current state of this patch we have attached a very small example
> consisting of an ARM STM32F205 program and a timing annotation XML file (see
> reply to this letter). You can provide the XML file to QEMU with the
> "-annotation <XML-File>" option. During execution, the "value_sum" field of
> the CPUState data structure will accumulate a total value of 70 (cycles).
>
> Are there any comments? Is this in general a good idea to be added to upstream
> QEMU?

Firstly, apologies for not getting round to replying to this earlier.
(I was hoping somebody else might have a more informed view.)
I think this is interesting, but it has a couple of issues that make
it not really suitable for mainline:
 (1) it's a bit askew from what QEMU currently does -- we don't
really do much in the way of providing introspection into what the
guest is doing
 (2) it feels a bit unpolished at the moment (lack of documentation,
doesn't have any existing analysis tools that produce the format that
the code reads that would make it immediately usable by an end-user)

I think that a design that would likely get better traction here with
QEMU upstream would be one where you had tracepoints for relevant
events like "executing new TB", and some means of writing a plugin
to run code on those events, or perhaps just a post-analysis tool that
ran on the trace file. Then the code for reading XML and adding up the
relevant annotations would be confined to the plugin and wouldn't
necessarily need to be upstream at all.

However you should take that design suggestion with a considerable
pinch of salt, as I am very much not up to speed with the current
state of our tracing infrastructure.

thanks
-- PMM

  parent reply	other threads:[~2016-01-25 13:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 10:55 [Qemu-devel] [RFC PATCH 0/3] (Resend) TranslationBlock annotation mechanism Peer Adelt
2016-01-14 10:55 ` [Qemu-devel] [RFC PATCH 1/3] tb-annotation: Added annotation XML file parser Peer Adelt
2016-01-14 10:55 ` [Qemu-devel] [RFC PATCH 2/3] tb-annotation: Add control flow graph mapper Peer Adelt
2016-01-14 10:55 ` [Qemu-devel] [RFC PATCH 3/3] tb-annotation: Activate annotation extension Peer Adelt
2016-01-14 10:57 ` [Qemu-devel] [RFC PATCH 0/3] (Resend) TranslationBlock annotation mechanism Peer Adelt
2016-01-25 13:54 ` Peter Maydell [this message]
2016-01-26 11:02   ` Bastian Koppelmann
2016-01-27 18:54     ` Lluís Vilanova
2016-01-28 13:40       ` Bastian Koppelmann
2016-01-28 18:29         ` Lluís Vilanova
2016-02-01 22:33           ` Lluís Vilanova
2016-01-28 15:26 ` Frederic Konrad
2016-02-04 14:59   ` Bastian Koppelmann

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='CAFEAcA8-7ZHaT0yw=aAn2Ewv72PLQnXkXBMNSxL1V2mFepa3Uw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=kbastian@mail.upb.de \
    --cc=pbonzini@redhat.com \
    --cc=peer.adelt@c-lab.de \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.