[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 9/9] trace: [tcg] Generate TCG code to trace gues
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v4 9/9] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis |
Date: |
Fri, 15 Jan 2016 17:38:42 +0100 |
User-agent: |
StGit/0.17.1-dirty |
Events with the 'tcg' and 'vcpu' properties will:
* Trace the translation-time event ('*_trans').
* Generate TCG code to call a function that traces the execution-time
event ('*_exec') iff the event is enabled for that vCPU.
Signed-off-by: Lluís Vilanova <address@hidden>
---
scripts/tracetool/format/tcg_h.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/tracetool/format/tcg_h.py
b/scripts/tracetool/format/tcg_h.py
index acaa963..42f3b1c 100644
--- a/scripts/tracetool/format/tcg_h.py
+++ b/scripts/tracetool/format/tcg_h.py
@@ -32,7 +32,7 @@ def generate(events, backend):
for e in events:
# just keep one of them
- if "tcg-trans" not in e.properties:
+ if "tcg-exec" not in e.properties:
continue
# get the original event definition
@@ -52,7 +52,11 @@ def generate(events, backend):
if "disable" not in e.properties:
out(' %(name_trans)s(%(argnames_trans)s);',
- ' gen_helper_%(name_exec)s(%(argnames_exec)s);',
+ ' if (%(cond)s) {',
+ ' gen_helper_%(name_exec)s(%(argnames_exec)s);',
+ ' }',
+ cond='trace_event_get_cpu_state(_cpu, TRACE_%s)' %
e.event_exec.name.upper()
+ if "vcpu" in e.properties else "true",
name_trans=e.event_trans.api(e.QEMU_TRACE),
name_exec=e.event_exec.api(e.QEMU_TRACE),
argnames_trans=", ".join(e.event_trans.args.names()),
- [Qemu-devel] [PATCH v4 0/9] trace: Per-vCPU tracing states, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 2/9] trace: Add 'vcpu' event property, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 3/9] trace: [tcg] Identify events with the 'vcpu' property, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 4/9] exec: [tcg] Refactor flush of per-CPU virtual TB cache, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 5/9] exec: [tcg] Use multiple physical TB caches, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 7/9] disas: Remove unused macro '_', Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 9/9] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v4 8/9] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 1/9] trace: Add support for vCPU pointers in trace events, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v4 6/9] exec: [tcg] Track which vCPU is performing translation and execution, Lluís Vilanova, 2016/01/15