aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/format/events_c.py
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2014-02-23 20:37:40 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-05-07 19:07:18 +0200
commit1dad2ce97345f3424c4990cb232b40a35d5e936b (patch)
tree1e7ebf28f38266aca24947f76294f8b6ac340bc5 /scripts/tracetool/format/events_c.py
parentef0bd3bba674769c7d36bf400fc4fe7ea43244c5 (diff)
trace: [tracetool] Minimize the amount of per-backend code
Backends now only contain the essential backend-specific code, and most of the work is moved to frontend code. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool/format/events_c.py')
-rw-r--r--scripts/tracetool/format/events_c.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index ea668ee099..2d97fa310a 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -16,14 +16,13 @@ __email__ = "stefanha@linux.vnet.ibm.com"
from tracetool import out
-def begin(events):
+def generate(events, backend):
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#include "trace.h"',
'#include "trace/generated-events.h"',
'#include "trace/control.h"',
- '',
- )
+ '')
out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
@@ -31,9 +30,7 @@ def begin(events):
out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s, .dstate = 0 },',
id = "TRACE_" + e.name.upper(),
name = e.name,
- sstate = "TRACE_%s_ENABLED" % e.name.upper(),
- )
+ sstate = "TRACE_%s_ENABLED" % e.name.upper())
out('};',
- '',
- )
+ '')