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