[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation |
Date: |
Fri, 31 Jan 2014 17:09:08 +0100 |
User-agent: |
StGit/0.16 |
Signed-off-by: Lluís Vilanova <address@hidden>
---
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 when the
event is disabled:
You can check both if the event has been disabled and is dynamically enabled at
the same time using the 'trace_event_get_state' routine (see header
"trace/control.h" for more information).
+
+=== "tcg" ===
+
+Guest code generated by TCG can be traced by defining an event with the "tcg"
+event property.
+
+In addition to the regular "trace_<eventname>" routine in the "trace.h" header,
+events with the "tcg" property also provide the routine "trace_<eventname>_tcg"
+in the "trace-tcg.h" header. This routine can be called during TCG code
+generation to automatically generate TCG code to call "trace_<eventname>"
during
+TCG code execution.
+
+Events with the "tcg" property can be declared in the "trace-events" file with
a
+mix of basic and TCG types. The "trace_<eventname>_tcg" routine will
+transparently take care of turning any non-TCG argument into a TCG value, and
+the "trace_<eventname>" routine will automatically receive non-TCG values.
+
+For example, the event (as would be declared in "trace-events"):
+
+ tcg foo(uint8_t a1, TCGv_i32 a2) "a1=%d a2=%d"
+
+Can be invoked as:
+
+ #include "helper.h"
+
+ void bar ()
+ {
+ uint8_t a1 = ...;
+ TCGv_i32 a2 = ...;
+ trace_foo_tcg(a1, a2);
+ }
+
+And the intermediate boilerplate code will take care of generating the TCG code
+to call (as would be declared in "trace.h"):
+
+ void trace_foo(uint8_t a1, uint32_t a2);
- [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 01/12] trace: [tcg] Add documentation,
Lluís Vilanova <=
- [Qemu-devel] [PATCH 02/12] trace: [tracetool, tcg] Allow TCG types in trace event declarations, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 03/12] trace: [tracetool] Add method 'Event.api' to get the name of public routines, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 04/12] trace: [tracetool, tcg] Provide TCG-related type transformation rules, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 05/12] trace: [tracetool] Allow argument types to be transformed, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 06/12] trace: [tcg] Declare TCG tracing helper routines, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 07/12] trace: [tcg] Define TCG tracing helper routines, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 09/12] trace: [tcg] Generate TCG tracing routines, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 10/12] trace: [trivial] Include event definitions in "trace.h", Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 12/12] trace: [all] Add "guest_vmem" event, Lluís Vilanova, 2014/01/31
- [Qemu-devel] [PATCH 11/12] trace: [tcg] Include TCG-tracing header on all targets, Lluís Vilanova, 2014/01/31