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
23 out('#include <ust/marker.h>',
25 '#undef mutex_unlock',
31 argnames = ", ".join(e.args.names())
33 argnames = ', ' + argnames
35 out('DEFINE_TRACE(ust_%(name)s);',
37 'static void ust_%(name)s_probe(%(args)s)',
39 ' trace_mark(ust, %(name)s, %(fmt)s%(argnames)s);',
48 out('DEFINE_TRACE(ust_%(name)s);',
50 'static void ust_%(name)s_probe(%(args)s)',
52 ' trace_mark(ust, %(name)s, UST_MARKER_NOARGS);',
60 'static void __attribute__((constructor)) trace_init(void)',
64 out(' register_trace_ust_%(name)s(ust_%(name)s_probe);',
72 out('#include <ust/tracepoint.h>',
74 '#undef mutex_unlock',
80 out('DECLARE_TRACE(ust_%(name)s, TP_PROTO(%(args)s), TP_ARGS(%(argnames)s));',
81 '#define trace_%(name)s trace_ust_%(name)s',
84 argnames = ", ".join(e.args.names()),
88 out('_DECLARE_TRACEPOINT_NOARGS(ust_%(name)s);',
89 '#define trace_%(name)s trace_ust_%(name)s',