From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41627 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PE8Pr-0005Sy-K6 for qemu-devel@nongnu.org; Thu, 04 Nov 2010 18:36:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PE8Pg-0002ev-Cw for qemu-devel@nongnu.org; Thu, 04 Nov 2010 18:36:09 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:47085 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PE8Pf-0002eh-Vz for qemu-devel@nongnu.org; Thu, 04 Nov 2010 18:36:08 -0400 From: =?utf-8?b?TGx1w61z?= Date: Thu, 04 Nov 2010 23:36:28 +0100 Message-ID: <20101104223628.16931.21689.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC][PATCH v2 0/4] trace-gen: support for trace points in code-generation routines List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org XXX: Must be applied on top of the 'trace-instrument' patch series Adds a new optional keyword ("gen") to the syntax in "trace-events". When specified, this event property will generate an extra set of functions that provide the ability to inject trace points into TCG-generated code. Note that the regular backend-dependant functions will also be generated. The extra files generated, and their functions are: - trace-helper.h Declares a 'trace_proxy_##name' TCG helper for each affected trace event. - trace-helper.c Defines a 'trace_proxy_##name' TCG helper for each affected trace event, which simply calls 'trace_##name'. Note that this scheme neatly blends with the "instrument" property. - trace-gen.h Defines a 'trace_gen_##name##_backend' function for each affected trace event, which handles all the (de)allocation of TCG temporaries and calls 'gen_helper_trace_proxy_##name'. If the "instrument" property is not present, 'trace_gen_##name' is defined as an alias. This file is instended to be included instead of "trace.h" for generating TCG calls to trace points. In order to fully exploit the information available during TCG code generation, trace events with the "gen" property can also use TCG data types (e.g., TCG_ptr), which are gracefully handled by 'tracetool' when generating the "trace.h" and "trace.c" files. v2: Rebase onto latest QEMU version (d33ea50a958b2e050d2b28e5f17e3b55e91c6d74). Handle trace events with an explicit "void" to indicate no arguments. TODO: * Check handling of TCGv_tl and target_long/target_ulong * Should not emit code in 'trace_gen_##name' if event has property "disable" (relates to previous' series comment on "disable" vs "simple"). * Check per-cpu event tracing state before calling 'gen_helper_trace_proxy_##name' (upcoming series) Signed-off-by: Lluís Vilanova --- Lluís Vilanova (4): trace-gen: gracefully handle TCG types in "trace-events" trace-gen: auto-generate TCG helper routines for tracing trace-gen: [all] include "trace-helper.h" on all "helper.h" files trace-gen: auto-generate wrappers to call TCG trace helpers .gitignore | 2 Makefile | 21 ++ Makefile.target | 5 - configure | 5 + simpletrace.py | 2 target-alpha/helper.h | 2 target-arm/helper.h | 2 target-cris/helper.h | 2 target-i386/helper.h | 2 target-m68k/helper.h | 2 target-microblaze/helper.h | 2 target-mips/helper.h | 2 target-ppc/helper.h | 2 target-sh4/helper.h | 2 target-sparc/helper.h | 2 trace-events | 8 + tracetool | 378 +++++++++++++++++++++++++++++++++++++++++++- 17 files changed, 430 insertions(+), 11 deletions(-)