Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging
[qemu.git] / scripts / tracetool / format / d.py
blob46eebb128b6c619b9cc58c7c502318273d63bf73
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 """
5 trace/generated-tracers.dtrace (DTrace only).
6 """
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 def generate(events, backend):
20 events = [e for e in events
21 if "disable" not in e.properties]
23 out('/* This file is autogenerated by tracetool, do not edit. */'
24 '',
25 'provider qemu {')
27 for e in events:
28 args = str(e.args)
30 # DTrace provider syntax expects foo() for empty
31 # params, not foo(void)
32 if args == 'void':
33 args = ''
35 # Define prototype for probe arguments
36 out('',
37 'probe %(name)s(%(args)s);',
38 name=e.name,
39 args=args)
41 out('',
42 '};')