trace: [tcg] Allow tracing guest events in TCG-generated code
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest12 patches 17 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | trace: [tcg] Add documentationdocs/ | +36 | 0 replies | |
| 2/12 | trace: [tracetool, tcg] Allow TCG types in trace event declarationsscripts/ | +7 | 0 replies | |
| 3/12 | trace: [tracetool] Add method 'Event.api' to get the name of public routinesscripts/ scripts/ scripts/ +3 more | +28 | 0 replies | |
| 4/12 | trace: [tracetool, tcg] Provide TCG-related type transformation rulesscripts/ | +157 | 0 replies | |
| 5/12 | trace: [tracetool] Allow argument types to be transformedscripts/ | +29 | 0 replies | |
| 6/12 | trace: [tcg] Declare TCG tracing helper routines.gitignore Makefile include/ +4 more | +155 | 0 replies | |
| 7/12 | trace: [tcg] Define TCG tracing helper routines.gitignore Makefile Makefile.objs +4 more | +72 | 0 replies | |
| 8/12 | trace: [tcg] Include TCG-tracing helpers on all helper.htarget-alpha/ target-arm/ target-cris/ +12 more | +30 | 0 replies | |
| 9/12 | trace: [tcg] Generate TCG tracing routines.gitignore Makefile include/ +3 more | +83 | 0 replies | |
| 10/12 | trace: [trivial] Include event definitions in "trace.h"include/ | +1 | 0 replies | |
| 11/12 | trace: [tcg] Include TCG-tracing header on all targetstarget-alpha/ target-arm/ target-cris/ +12 more | +44 | 0 replies | |
| 12/12 | trace: [all] Add "guest_vmem" eventinclude/ include/ include/ +4 more | +129 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code
Adds the base ability to specify which events in the "trace-events" file may be used to trace guest activity in the TCG code (using the "tcg" event propery).
Such events generate an extra set of tracing functions that can be called during TCG code generation and will automatically redirect a call to the appropriate backend-dependent tracing functions when the guest code is executed.
Files generating guest code (TCG) must include "trace-tcg.h". Files declaring per-target helpers ("${target}/helper.h") must include "trace/generated-helpers.h".
The flow of the generated routines is:
[At translation time]
* trace_${name}_tcg(bool, TCGv)
Declared: "trace/generated-tcg-tracers.h"
Defined : "trace/generated-tcg-tracers.h"
* gen_helper_trace_${name}_tcg(bool, TCGv)
Declared: "trace/generated-helpers.h"
Defined : "trace/generated-helpers.h"
Automatically transforms all the arguments and allocates them into the appropriate TCG temporary values (which are also freed). Provides a more streamlined interface by allowing events in "trace-events" to take a mix of tracing-supported types and TCG types.
* gen_helper_trace_${name}_tcg_proxy(TCGi32, TCGv)
Declared: "trace/generated-helpers.h"
Defined : "trace/generated-helpers.h" (using helper machinery)
The actual TCG helper function, created using QEMU's TCG helper machinery.
[At execution time]
* helper_trace_${name}_tcg_proxy(uint32_t, uint64_t)
Declared: "trace/generated-helpers.h" Defined : "trace/generated-helpers.c"
Performs the appropriate argument type casts to match the signature of the callee.
* trace_${name}(bool, uint64_t)
The already-existing tracing function.
---
Lluís Vilanova (12):
trace: [tcg] Add documentation
trace: [tracetool,tcg] Allow TCG types in trace event declarations
trace: [tracetool] Add method 'Event.api' to get the name of public routines
trace: [tracetool,tcg] Provide TCG-related type transformation rules
trace: [tracetool] Allow argument types to be transformed
trace: [tcg] Declare TCG tracing helper routines
trace: [tcg] Define TCG tracing helper routines
trace: [tcg] Include TCG-tracing helpers on all helper.h
trace: [tcg] Generate TCG tracing routines
trace: [trivial] Include event definitions in "trace.h"
trace: [tcg] Include TCG-tracing header on all targets
trace: [all] Add "guest_vmem" event
.gitignore | 3 + Makefile | 5 + Makefile.objs | 8 +- Makefile.target | 1 docs/tracing.txt | 36 +++++++ include/exec/cpu-all.h | 58 ++++++----- include/exec/def-helper.h | 9 ++ include/exec/exec-all.h | 3 + include/exec/softmmu_header.h | 17 +++ include/trace-tcg.h | 7 + include/trace.h | 1 scripts/tracetool/__init__.py | 49 +++++++++ scripts/tracetool/backend/dtrace.py | 6 + scripts/tracetool/backend/simple.py | 10 +- scripts/tracetool/backend/stderr.py | 5 + scripts/tracetool/backend/tcg.py | 125 ++++++++++++++++++++++++ scripts/tracetool/backend/ust.py | 8 +- scripts/tracetool/format/h.py | 6 + scripts/tracetool/format/tcg_h.py | 47 +++++++++ scripts/tracetool/format/tcg_helper_c.py | 27 +++++ scripts/tracetool/format/tcg_helper_h.py | 38 +++++++ scripts/tracetool/transform.py | 157 ++++++++++++++++++++++++++++++ target-alpha/helper.h | 2 target-alpha/translate.c | 3 + target-arm/helper.h | 2 target-arm/translate.c | 3 + target-cris/helper.h | 2 target-cris/translate.c | 3 + target-i386/helper.h | 2 target-i386/translate.c | 3 + target-lm32/helper.h | 2 target-lm32/translate.c | 3 + target-m68k/helper.h | 2 target-m68k/translate.c | 3 + target-microblaze/helper.h | 2 target-microblaze/translate.c | 3 + target-mips/helper.h | 2 target-mips/translate.c | 3 + target-openrisc/helper.h | 2 target-openrisc/translate.c | 3 + target-ppc/helper.h | 2 target-ppc/translate.c | 3 + target-s390x/helper.h | 2 target-s390x/translate.c | 2 target-sh4/helper.h | 2 target-sh4/translate.c | 3 + target-sparc/helper.h | 2 target-sparc/translate.c | 3 + target-unicore32/helper.h | 2 target-unicore32/translate.c | 3 + target-xtensa/helper.h | 2 target-xtensa/translate.c | 3 + tcg/tcg-op.h | 8 ++ tcg/tcg.c | 1 trace-events | 15 +++ trace/Makefile.objs | 45 ++++++++- trace/tcg-op-internal.h | 55 +++++++++++ 57 files changed, 771 insertions(+), 53 deletions(-) create mode 100644 include/trace-tcg.h create mode 100644 scripts/tracetool/backend/tcg.py create mode 100644 scripts/tracetool/format/tcg_h.py create mode 100644 scripts/tracetool/format/tcg_helper_c.py create mode 100644 scripts/tracetool/format/tcg_helper_h.py create mode 100644 scripts/tracetool/transform.py create mode 100644 trace/tcg-op-internal.h