aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/format
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tracetool/format')
-rw-r--r--scripts/tracetool/format/events_c.py9
-rw-r--r--scripts/tracetool/format/events_h.py3
2 files changed, 10 insertions, 2 deletions
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index 4012063..ef873fa 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -25,6 +25,9 @@ def generate(events, backend):
'#include "trace/control.h"',
'')
+ for e in events:
+ out('uint16_t %s;' % e.api(e.QEMU_DSTATE))
+
out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
for e in events:
@@ -34,11 +37,13 @@ def generate(events, backend):
vcpu_id = "TRACE_VCPU_EVENT_COUNT"
out(' { .id = %(id)s, .vcpu_id = %(vcpu_id)s,'
' .name = \"%(name)s\",'
- ' .sstate = %(sstate)s },',
+ ' .sstate = %(sstate)s,',
+ ' .dstate = &%(dstate)s, }, ',
id = "TRACE_" + e.name.upper(),
vcpu_id = vcpu_id,
name = e.name,
- sstate = "TRACE_%s_ENABLED" % e.name.upper())
+ sstate = "TRACE_%s_ENABLED" % e.name.upper(),
+ dstate = e.api(e.QEMU_DSTATE))
out('};',
'')
diff --git a/scripts/tracetool/format/events_h.py b/scripts/tracetool/format/events_h.py
index a9da60b..03417de 100644
--- a/scripts/tracetool/format/events_h.py
+++ b/scripts/tracetool/format/events_h.py
@@ -32,6 +32,9 @@ def generate(events, backend):
out(' TRACE_EVENT_COUNT',
'} TraceEventID;')
+ for e in events:
+ out('extern uint16_t %s;' % e.api(e.QEMU_DSTATE))
+
# per-vCPU event identifiers
out('typedef enum {')