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
20 out('#include <ust/marker.h>',
22 '#undef mutex_unlock',
28 argnames = ", ".join(e.args.names())
30 argnames = ', ' + argnames
32 out('DEFINE_TRACE(ust_%(name)s);',
34 'static void ust_%(name)s_probe(%(args)s)',
36 ' trace_mark(ust, %(name)s, %(fmt)s%(argnames)s);',
45 out('DEFINE_TRACE(ust_%(name)s);',
47 'static void ust_%(name)s_probe(%(args)s)',
49 ' trace_mark(ust, %(name)s, UST_MARKER_NOARGS);',
57 'static void __attribute__((constructor)) trace_init(void)',
61 out(' register_trace_ust_%(name)s(ust_%(name)s_probe);',
69 out('#include <ust/tracepoint.h>',
71 '#undef mutex_unlock',
77 out('DECLARE_TRACE(ust_%(name)s, TP_PROTO(%(args)s), TP_ARGS(%(argnames)s));',
78 '#define trace_%(name)s trace_ust_%(name)s',
81 argnames = ", ".join(e.args.names()),
85 out('_DECLARE_TRACEPOINT_NOARGS(ust_%(name)s);',
86 '#define trace_%(name)s trace_ust_%(name)s',