Received: from eggs.gnu.org ([2001:4830:134:3::10]:41405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Gec-0007p9-Sv for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:09:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9GeU-0000mg-5u for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:09:18 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:58446 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9GeT-0000mc-PF for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:09:10 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 31 Jan 2014 17:09:08 +0100 Message-Id: <20140131160908.32741.6227.stgit@fimbulvetr.bsc.es> In-Reply-To: <20140131160902.32741.2680.stgit@fimbulvetr.bsc.es> References: <20140131160902.32741.2680.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi Signed-off-by: Llu=C3=ADs Vilanova --- docs/tracing.txt | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/tracing.txt b/docs/tracing.txt index bfc261b..9bf7073 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -271,3 +271,39 @@ guard such computations and avoid its compilation wh= en the event is disabled: You can check both if the event has been disabled and is dynamically ena= bled at the same time using the 'trace_event_get_state' routine (see header "trace/control.h" for more information). + +=3D=3D=3D "tcg" =3D=3D=3D + +Guest code 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 also provide the routine "trace__tcg" +in the "trace-tcg.h" header. This routine can be called during TCG code +generation to automatically generate TCG code to call "trace_= " during +TCG code execution. + +Events with the "tcg" property can be declared in the "trace-events" fil= e with a +mix of basic and TCG types. The "trace__tcg" routine will +transparently take care of turning any non-TCG argument into a TCG value= , and +the "trace_" routine will automatically receive non-TCG value= s. + +For example, the event (as would be declared in "trace-events"): + + tcg foo(uint8_t a1, TCGv_i32 a2) "a1=3D%d a2=3D%d" + +Can be invoked as: + + #include "helper.h" + =20 + void bar () + { + uint8_t a1 =3D ...; + TCGv_i32 a2 =3D ...; + trace_foo_tcg(a1, a2); + } + +And the intermediate boilerplate code will take care of generating the T= CG code +to call (as would be declared in "trace.h"): + + void trace_foo(uint8_t a1, uint32_t a2);