]>
git.proxmox.com Git - mirror_qemu.git/blob - scripts/tracetool/backend/ust.py
2 # -*- coding: utf-8 -*-
5 LTTng User Space Tracing backend.
8 __author__
= "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__
= "Copyright 2012, 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
26 out('#include <lttng/tracepoint.h>',
27 '#include "trace/generated-ust-provider.h"',
30 argnames
= ", ".join(e
.args
.names())
32 argnames
= ", " + argnames
34 out('static inline void trace_%(name)s(%(args)s)',
36 ' tracepoint(qemu, %(name)s%(tp_args)s);',
44 def ust_events_c(events
):
47 def ust_events_h(events
):
50 out('TRACEPOINT_EVENT(',
53 ' TP_ARGS(%(args)s),',
56 args
= ", ".join(", ".join(i
) for i
in e
.args
),
60 if ('int' in t
) or ('long' in t
) or ('unsigned' in t
) or ('size_t' in t
):
61 out(' ctf_integer(' + t
+ ', ' + n
+ ', ' + n
+ ')')
62 elif ('double' in t
) or ('float' in t
):
63 out(' ctf_float(' + t
+ ', ' + n
+ ', ' + n
+ ')')
64 elif ('char *' in t
) or ('char*' in t
):
65 out(' ctf_string(' + n
+ ', ' + n
+ ')')
66 elif ('void *' in t
) or ('void*' in t
):
67 out(' ctf_integer_hex(unsigned long, ' + n
+ ', ' + n
+ ')')
74 out('TRACEPOINT_EVENT(',