aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/backend/simple.py
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2013-03-05 14:47:55 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-28 14:19:57 +0100
commit60481e210d1f5f9e97d4d5db82b9afb8d3df7acf (patch)
tree72ac24ca5fdfdf45a834b133f74f4b8fb8217884 /scripts/tracetool/backend/simple.py
parentfd068a953ccb54a00e7b1cf2d8961498c7d74bd4 (diff)
trace: [simple] Port to generic event information and new control interface
The backend is forced to dump event numbers using 64 bits, as TraceEventID is an enum. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool/backend/simple.py')
-rw-r--r--scripts/tracetool/backend/simple.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index ac864f38ce..37ef599324 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -28,17 +28,10 @@ def is_string(arg):
def c(events):
out('#include "trace.h"',
+ '#include "trace/control.h"',
'#include "trace/simple.h"',
'',
- 'TraceEvent trace_list[] = {')
-
- for e in events:
- out('{.tp_name = "%(name)s", .state=0},',
- name = e.name,
- )
-
- out('};',
- '')
+ )
for num, event in enumerate(events):
out('void trace_%(name)s(%(args)s)',
@@ -63,7 +56,9 @@ def c(events):
out('',
- ' if (!trace_list[%(event_id)s].state) {',
+ ' TraceEvent *eventp = trace_event_id(%(event_id)s);',
+ ' bool _state = trace_event_get_state_dynamic(eventp);',
+ ' if (!_state) {',
' return;',
' }',
'',
@@ -106,6 +101,3 @@ def h(events):
name = event.name,
args = event.args,
)
- out('')
- out('#define NR_TRACE_EVENTS %d' % len(events))
- out('extern TraceEvent trace_list[NR_TRACE_EVENTS];')