]> git.proxmox.com Git - mirror_qemu.git/blame - scripts/tracetool/backend/dtrace.py
trace: switch to modular code generation for sub-directories
[mirror_qemu.git] / scripts / tracetool / backend / dtrace.py
CommitLineData
52ef093a
LV
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""
5DTrace/SystemTAP backend.
6"""
7
8__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
40b9cd25 9__copyright__ = "Copyright 2012-2016, 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
16from tracetool import out
17
18
93fba161
LV
19PUBLIC = True
20
21
52ef093a
LV
22PROBEPREFIX = None
23
1dad2ce9 24def probeprefix():
52ef093a
LV
25 if PROBEPREFIX is None:
26 raise ValueError("you must set PROBEPREFIX")
27 return PROBEPREFIX
28
29
30BINARY = None
31
1dad2ce9 32def binary():
52ef093a
LV
33 if BINARY is None:
34 raise ValueError("you must set BINARY")
35 return BINARY
36
37
80dd5c49 38def generate_h_begin(events, group):
0ab8ed18
DB
39 if group == "root":
40 header = "trace-dtrace-root.h"
41 else:
42 header = "trace-dtrace.h"
43
44 out('#include "%s"' % header,
52ef093a
LV
45 '')
46
1dad2ce9 47
80dd5c49 48def generate_h(event, group):
40b9cd25 49 out(' QEMU_%(uppername)s(%(argnames)s);',
1dad2ce9
LV
50 uppername=event.name.upper(),
51 argnames=", ".join(event.args.names()))