2 # -*- coding: utf-8 -*-
5 trace/generated-tracers.dtrace (DTrace only).
8 __author__
= "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__
= "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
10 __license__
= "GPL version 2 or (at your option) any later version"
12 __maintainer__
= "Stefan Hajnoczi"
13 __email__
= "stefanha@linux.vnet.ibm.com"
16 from tracetool
import out
19 # Reserved keywords from
20 # https://wikis.oracle.com/display/DTrace/Types,+Operators+and+Expressions
22 'auto', 'goto', 'sizeof', 'break', 'if', 'static', 'case', 'import',
23 'string', 'char', 'inline', 'stringof', 'const', 'int', 'struct',
24 'continue', 'long', 'switch', 'counter', 'offsetof', 'this',
25 'default', 'probe', 'translator', 'do', 'provider', 'typedef',
26 'double', 'register', 'union', 'else', 'restrict', 'unsigned',
27 'enum', 'return', 'void', 'extern', 'self', 'volatile', 'float',
28 'short', 'while', 'for', 'signed', 'xlate',
32 def generate(events
, backend
):
33 events
= [e
for e
in events
34 if "disable" not in e
.properties
]
36 out('/* This file is autogenerated by tracetool, do not edit. */'
42 for type_
, name
in e
.args
:
43 if name
in RESERVED_WORDS
:
45 args
.append(type_
+ ' ' + name
)
47 # Define prototype for probe arguments
49 'probe %(name)s(%(args)s);',