[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 01/11] trace: [tcg] Add documentation
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v5 01/11] trace: [tcg] Add documentation |
Date: |
Fri, 30 May 2014 14:11:26 +0200 |
User-agent: |
StGit/0.17.1-dirty |
Signed-off-by: Lluís Vilanova <address@hidden>
---
docs/tracing.txt | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index c6ab1c1..2e035a5 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -307,3 +307,43 @@ 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. Internally, this property generates two events:
+"<eventname>_trans" to trace the event at translation time, and
+"<eventname>_exec" to trace the event at execution time.
+
+Instead of using these two events, you should instead use the function
+"trace_<eventname>_tcg" during translation (TCG code generation). This function
+will automatically call "trace_<eventname>_trans", and will generate the
+necessary TCG code to call "trace_<eventname>_exec" during guest code
execution.
+
+Events with the "tcg" property can be declared in the "trace-events" file with
a
+mix of native and TCG types, and "trace_<eventname>_tcg" will gracefully
forward
+them to the "<eventname>_trans" and "<eventname>_exec" events. Since TCG values
+are not known at translation time, these are ignored by the "<eventname>_trans"
+event. Because of this, the entry in the "trace-events" file needs two printing
+formats (separated by a comma):
+
+ tcg foo(uint8_t a1, TCGv_i32 a2) "a1=%d", "a1=%d a2=%d"
+
+For example:
+
+ #include "trace-tcg.h"
+
+ void some_disassembly_func (...)
+ {
+ uint8_t a1 = ...;
+ TCGv_i32 a2 = ...;
+ trace_foo_tcg(a1, a2);
+ }
+
+This will immediately call:
+
+ void trace_foo_trans(uint8_t a1);
+
+and will generate the TCG code to call:
+
+ void trace_foo(uint8_t a1, uint32_t a2);
- [Qemu-devel] [PATCH v5 00/11] trace: [tcg] Allow tracing guest events in TCG-generated code, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 04/11] trace: [tcg] Add 'tcg' event property, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 03/11] trace: [tcg] Argument type transformation machinery, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 01/11] trace: [tcg] Add documentation,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v5 06/11] trace: [tcg] Define TCG tracing helper routines, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 02/11] trace: [tcg] Argument type transformation rules, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 08/11] trace: [tcg] Include TCG-tracing helpers, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 07/11] trace: [tcg] Define TCG tracing helper routine wrappers, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 09/11] trace: [tcg] Generate TCG tracing routines, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 05/11] trace: [tcg] Declare TCG tracing helper routines, Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 10/11] trace: [tcg] Include event definitions in "trace.h", Lluís Vilanova, 2014/05/30
- [Qemu-devel] [PATCH v5 11/11] trace: [tcg] Include TCG-tracing header on all targets, Lluís Vilanova, 2014/05/30
- Re: [Qemu-devel] [PATCH v5 00/11] trace: [tcg] Allow tracing guest events in TCG-generated code, Richard Henderson, 2014/05/30