aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/format/events_c.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-07-19 10:54:49 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-07-19 10:54:49 +0100
commit0c1b58f25025cc09463aae235162b19ff45c37b7 (patch)
tree93f05bbeadc130a91399cc98ac3c914df87958e3 /scripts/tracetool/format/events_c.py
parent08b558f07bf67abf759e67266a83a8effdc34139 (diff)
parent77e2b17272963c09e309315903f3781dbdd85341 (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Mon 18 Jul 2016 22:59:55 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace: Add QAPI/QMP interfaces to query and control per-vCPU tracing state trace: Allow event name pattern in "info trace-events" trace: Conditionally trace events based on their per-vCPU state trace: Add per-vCPU tracing states for events with the 'vcpu' property trace: Cosmetic changes on fast-path tracing disas: Remove unused macro '_' trace: Identify events with the 'vcpu' property trace: [bsd-user] Commandline arguments to control tracing trace: [linux-user] Commandline arguments to control tracing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/tracetool/format/events_c.py')
-rw-r--r--scripts/tracetool/format/events_c.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index 1cc6a49a71..4012063283 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -6,7 +6,7 @@ trace/generated-events.c
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
+__copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
@@ -28,8 +28,15 @@ def generate(events, backend):
out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
for e in events:
- out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s },',
+ if "vcpu" in e.properties:
+ vcpu_id = "TRACE_VCPU_" + e.name.upper()
+ else:
+ vcpu_id = "TRACE_VCPU_EVENT_COUNT"
+ out(' { .id = %(id)s, .vcpu_id = %(vcpu_id)s,'
+ ' .name = \"%(name)s\",'
+ ' .sstate = %(sstate)s },',
id = "TRACE_" + e.name.upper(),
+ vcpu_id = vcpu_id,
name = e.name,
sstate = "TRACE_%s_ENABLED" % e.name.upper())