]>
Commit | Line | Data |
---|---|---|
52ef093a LV |
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>" | |
7d08f0da | 9 | __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" |
52ef093a LV |
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 | ||
93fba161 LV |
19 | PUBLIC = True |
20 | ||
21 | ||
52ef093a LV |
22 | PROBEPREFIX = None |
23 | ||
1dad2ce9 | 24 | def probeprefix(): |
52ef093a LV |
25 | if PROBEPREFIX is None: |
26 | raise ValueError("you must set PROBEPREFIX") | |
27 | return PROBEPREFIX | |
28 | ||
29 | ||
30 | BINARY = None | |
31 | ||
1dad2ce9 | 32 | def binary(): |
52ef093a LV |
33 | if BINARY is None: |
34 | raise ValueError("you must set BINARY") | |
35 | return BINARY | |
36 | ||
37 | ||
1dad2ce9 | 38 | def generate_h_begin(events): |
eac236ea | 39 | out('#include "trace/generated-tracers-dtrace.h"', |
52ef093a LV |
40 | '') |
41 | ||
1dad2ce9 LV |
42 | |
43 | def generate_h(event): | |
44 | out(' QEMU_%(uppername)s(%(argnames)s);', | |
45 | uppername=event.name.upper(), | |
46 | argnames=", ".join(event.args.names())) |