Add qemu 2.4.0
[kvmfornfv.git] / qemu / scripts / tracetool / backend / dtrace.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 DTrace/SystemTAP backend.
6 """
7
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"
11
12 __maintainer__ = "Stefan Hajnoczi"
13 __email__      = "stefanha@linux.vnet.ibm.com"
14
15
16 from tracetool import out
17
18
19 PUBLIC = True
20
21
22 PROBEPREFIX = None
23
24 def probeprefix():
25     if PROBEPREFIX is None:
26         raise ValueError("you must set PROBEPREFIX")
27     return PROBEPREFIX
28
29
30 BINARY = None
31
32 def binary():
33     if BINARY is None:
34         raise ValueError("you must set BINARY")
35     return BINARY
36
37
38 def generate_h_begin(events):
39     out('#include "trace/generated-tracers-dtrace.h"',
40         '')
41
42
43 def generate_h(event):
44     out('    QEMU_%(uppername)s(%(argnames)s);',
45         uppername=event.name.upper(),
46         argnames=", ".join(event.args.names()))