aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/format/events_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tracetool/format/events_c.py')
-rw-r--r--scripts/tracetool/format/events_c.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index ef873fa137..a97054fd58 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -28,22 +28,29 @@ def generate(events, backend):
for e in events:
out('uint16_t %s;' % e.api(e.QEMU_DSTATE))
- out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
-
for e in events:
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,',
- ' .dstate = &%(dstate)s, }, ',
+ out('TraceEvent %(event)s = {',
+ ' .id = %(id)s,',
+ ' .vcpu_id = %(vcpu_id)s,',
+ ' .name = \"%(name)s\",',
+ ' .sstate = %(sstate)s,',
+ ' .dstate = &%(dstate)s ',
+ '};',
+ event = e.api(e.QEMU_EVENT),
id = "TRACE_" + e.name.upper(),
vcpu_id = vcpu_id,
name = e.name,
sstate = "TRACE_%s_ENABLED" % e.name.upper(),
dstate = e.api(e.QEMU_DSTATE))
+ out('TraceEvent *trace_events[TRACE_EVENT_COUNT] = {')
+
+ for e in events:
+ out(' &%(event)s,', event = e.api(e.QEMU_EVENT))
+
out('};',
'')