diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-08-15 16:37:17 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-08-15 16:37:17 +0100 |
commit | 5c6b3c50cca2106e5fbcbc6efa94c2f8b9d29fd8 (patch) | |
tree | 130b8de581b48b1bf1862b4f5f1e8001955cc47e /docs | |
parent | f2fb1da9412ae7b4cb512cfbd86c0185f191e2f9 (diff) | |
parent | 4ac4458076e1aaf3b01a6361154117df20e22215 (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Tracing pull request
* remotes/stefanha/tags/tracing-pull-request:
virtio-rng: add some trace events
trace: add some tcg tracing support
trace: teach lttng backend to use format strings
trace: [tcg] Include TCG-tracing header on all targets
trace: [tcg] Include event definitions in "trace.h"
trace: [tcg] Generate TCG tracing routines
trace: [tcg] Include TCG-tracing helpers
trace: [tcg] Define TCG tracing helper routine wrappers
trace: [tcg] Define TCG tracing helper routines
trace: [tcg] Declare TCG tracing helper routines
trace: [tcg] Add 'tcg' event property
trace: [tcg] Argument type transformation machinery
trace: [tcg] Argument type transformation rules
trace: [tcg] Add documentation
trace: install simpletrace SystemTap tapset
simpletrace: add simpletrace.py --no-header option
trace: add tracetool simpletrace_stap format
trace: extract stap_escape() function for reuse
Conflicts:
Makefile.objs
Diffstat (limited to 'docs')
-rw-r--r-- | docs/tracing.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/docs/tracing.txt b/docs/tracing.txt index c6ab1c11c1..2e035a5b3c 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); |