From: Richard Henderson <rth@twiddle.net>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code
Date: Tue, 04 Feb 2014 06:57:01 -0800 [thread overview]
Message-ID: <52F0FFBD.8050801@twiddle.net> (raw)
In-Reply-To: <20140131160902.32741.2680.stgit@fimbulvetr.bsc.es>
On 01/31/2014 08:09 AM, Lluís Vilanova wrote:
> Adds the base ability to specify which events in the "trace-events" file may be
> used to trace guest activity in the TCG code (using the "tcg" event propery).
>
> Such events generate an extra set of tracing functions that can be called during
> TCG code generation and will automatically redirect a call to the appropriate
> backend-dependent tracing functions when the guest code is executed.
>
> Files generating guest code (TCG) must include "trace-tcg.h". Files declaring
> per-target helpers ("${target}/helper.h") must include
> "trace/generated-helpers.h".
>
> The flow of the generated routines is:
>
>
> [At translation time]
>
> * trace_${name}_tcg(bool, TCGv)
> Declared: "trace/generated-tcg-tracers.h"
> Defined : "trace/generated-tcg-tracers.h"
>
> * gen_helper_trace_${name}_tcg(bool, TCGv)
> Declared: "trace/generated-helpers.h"
> Defined : "trace/generated-helpers.h"
>
> Automatically transforms all the arguments and allocates them into the
> appropriate TCG temporary values (which are also freed). Provides a more
> streamlined interface by allowing events in "trace-events" to take a mix of
> tracing-supported types and TCG types.
>
> * gen_helper_trace_${name}_tcg_proxy(TCGi32, TCGv)
> Declared: "trace/generated-helpers.h"
> Defined : "trace/generated-helpers.h" (using helper machinery)
>
> The actual TCG helper function, created using QEMU's TCG helper machinery.
I suppose I have no major objection to the feature, although frankly it's
not especially exciting. I can't really imagine ever wanting to bulk trace
all of the helpers. Tracing specific helpers on a target-by-target basis,
sure. But that can be done just as easily as adding tracing code to any
other bit of C.
If I read these patches right -- and since they're mostly python I'm not
sure that I am -- we go through 5 layers of wrappers to get to the current
trace_foo expansion. Where trace_foo contains the check to see whether the
tracepoint is actually enabled.
I would strongly suggest this is backward. One should perform the check for
the tracepoint being enabled at translation time before emitting the call to
the helper in the first place.
r~
next prev parent reply other threads:[~2014-02-04 14:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 16:09 [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 02/12] trace: [tracetool, tcg] Allow TCG types in trace event declarations Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 03/12] trace: [tracetool] Add method 'Event.api' to get the name of public routines Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 04/12] trace: [tracetool, tcg] Provide TCG-related type transformation rules Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 05/12] trace: [tracetool] Allow argument types to be transformed Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 06/12] trace: [tcg] Declare TCG tracing helper routines Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 07/12] trace: [tcg] Define " Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 08/12] trace: [tcg] Include TCG-tracing helpers on all helper.h Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 09/12] trace: [tcg] Generate TCG tracing routines Lluís Vilanova
2014-01-31 16:09 ` [Qemu-devel] [PATCH 10/12] trace: [trivial] Include event definitions in "trace.h" Lluís Vilanova
2014-01-31 16:10 ` [Qemu-devel] [PATCH 11/12] trace: [tcg] Include TCG-tracing header on all targets Lluís Vilanova
2014-01-31 16:10 ` [Qemu-devel] [PATCH 12/12] trace: [all] Add "guest_vmem" event Lluís Vilanova
2014-02-04 15:08 ` Richard Henderson
2014-02-04 20:01 ` Lluís Vilanova
2014-02-06 16:12 ` Richard Henderson
2014-02-10 13:29 ` Lluís Vilanova
2014-02-03 14:40 ` [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code Stefan Hajnoczi
2014-02-03 16:24 ` Lluís Vilanova
2014-02-04 14:57 ` Richard Henderson [this message]
2014-02-04 15:02 ` Peter Maydell
2014-02-04 15:17 ` Richard Henderson
2014-02-04 20:44 ` Lluís Vilanova
2014-02-04 20:34 ` Lluís Vilanova
2014-02-04 20:33 ` Lluís Vilanova
2014-02-06 15:57 ` Richard Henderson
2014-02-06 19:26 ` Lluís Vilanova
2014-02-07 14:49 ` Richard Henderson
2014-02-07 15:13 ` Peter Maydell
2014-02-07 15:24 ` Lluís Vilanova
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=52F0FFBD.8050801@twiddle.net \
--to=rth@twiddle.net \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--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.