diff options
Diffstat (limited to 'scripts/tracetool/backend/simple.py')
-rw-r--r-- | scripts/tracetool/backend/simple.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py index e4b4a7f05d..37ef599324 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -15,6 +15,10 @@ __email__ = "stefanha@linux.vnet.ibm.com" from tracetool import out + +PUBLIC = True + + def is_string(arg): strtype = ('const char*', 'char*', 'const char *', 'char *') if arg.lstrip().startswith(strtype): @@ -24,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)', @@ -59,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;', ' }', '', @@ -102,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];') |