Received: from eggs.gnu.org ([140.186.70.92]:56965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmlV-0002wC-4P for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:48:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYmlT-0008DH-DU for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:48:33 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:37241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmlS-0008D1-VZ for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:48:31 -0500 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id E9CC46B02C9 for ; Thu, 8 Dec 2011 23:48:29 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova Date: Thu, 08 Dec 2011 23:48:22 +0100 Message-ID: <20111208224822.21668.59841.stgit@ginnungagap.bsc.es> In-Reply-To: <20111208224750.21668.26153.stgit@ginnungagap.bsc.es> References: <20111208224750.21668.26153.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 02/10] trace-tcg: Add documentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Llu=C3=ADs Vilanova --- docs/tracing.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index 853cbf8..44c5dba 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -244,3 +244,43 @@ In this case you should declare such event with the = "disable" property. This will effectively disable the event at compile time (by using the "nop" b= ackend), thus having no performance impact at all on regular builds (i.e., unless= you edit the "trace-events" file). + +=3D=3D=3D "tcg" =3D=3D=3D + +Code from the guest generated by TCG can be traced by defining an event = with the +"tcg" event property. + +In addition to the regular "trace_" routine in the "trace.h" = header, +events with the "tcg" property will also provide the TCG helper routine +"gen_helper_trace_". This routine can be called during TCG co= de +generation as any other TCG helper to automatically generate TCG code to= call +"trace_" during TCG code execution. + +The notable difference is that these events can be declared in the +"trace-events" file with both basic types as well as TCG types. The +"gen_helper_trace_" routine will transparently take care of t= urning +any non-TCG argument into a TCG value. + +For example, the event: + + tcg foo(uint8_t a1, TCGv_i32 a2) "a1=3D%d a2=3D%d" + +Can be invoked from TCG code as: + + uint8_t a1 =3D ...; + TCGv_i32 a2 =3D ...; + gen_helper_trace_foo(a1, a2); + +And the intermediate boilerplate code will take care of generating the T= CG code +to call: + + void trace_foo(uint8_t a1, uint32_t a2); + +=3D=3D=3D "tcg-vcpu" =3D=3D=3D + +Events with the "tcg" property will generate code helpers with the +"TCG_CALL_CONST" flag (see "tcg/README" and "tcg/tcg.h"), which produces= faster +code that is unable to reliably access the state of the vCPU. + +Using the "tcg-vcpu" property will generate a slower TCG helper that wil= l be +able to reliably get and set values from the vCPU.