[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/10] trace: [tcg] Generate TCG code to trace gu
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v2 10/10] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis |
Date: |
Tue, 24 Nov 2015 18:09: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 222002c..2ecfc53 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 v2 03/10] trace: [tcg] Identify events with the 'vcpu' property, (continued)
- [Qemu-devel] [PATCH v2 03/10] trace: [tcg] Identify events with the 'vcpu' property, Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 05/10] exec: [ŧcg] Use multiple physical TB caches, Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 04/10] exec: [tcg] Refactor flush of per-CPU virtual TB cache, Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 08/10] disas: Remove unused macro '_', Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 07/10] [trivial] Track when QEMU has finished initialization, Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 09/10] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property, Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 01/10] trace: Add support for vCPU pointers in trace events, Lluís Vilanova, 2015/11/24
- [Qemu-devel] [PATCH v2 10/10] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v2 06/10] exec: [tcg] Track which vCPU is performing translation and execution, Lluís Vilanova, 2015/11/24