]> git.proxmox.com Git - mirror_qemu.git/blob - scripts/tracetool/backend/ust.py
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20170717.0' into...
[mirror_qemu.git] / scripts / tracetool / backend / ust.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 LTTng User Space Tracing backend.
6 """
7
8 __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__ = "Copyright 2012-2017, 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 def generate_h_begin(events, group):
23 if group == "root":
24 header = "trace-ust-root.h"
25 else:
26 header = "trace-ust.h"
27
28 out('#include <lttng/tracepoint.h>',
29 '#include "%s"' % header,
30 '')
31
32
33 def generate_h(event, group):
34 argnames = ", ".join(event.args.names())
35 if len(event.args) > 0:
36 argnames = ", " + argnames
37
38 out(' tracepoint(qemu, %(name)s%(tp_args)s);',
39 name=event.name,
40 tp_args=argnames)