Migrate tracepoint instrumentation to TP_FIELDS
[lttng-modules.git] / probes / define_trace.h
CommitLineData
17baffe2
MD
1/*
2 * define_trace.h
3 *
4 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
886d51a3 5 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
17baffe2 6 *
886d51a3
MD
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; only
10 * version 2.1 of the License.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17baffe2
MD
20 */
21
f62b389e
MD
22/*
23 * Trace files that want to automate creationg of all tracepoints defined
24 * in their file should include this file. The following are macros that the
25 * trace file may define:
26 *
27 * TRACE_SYSTEM defines the system the tracepoint is for
28 *
29 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
30 * This macro may be defined to tell define_trace.h what file to include.
31 * Note, leave off the ".h".
32 *
33 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
34 * then this macro can define the path to use. Note, the path is relative to
35 * define_trace.h, not the file including it. Full path names for out of tree
36 * modules must be used.
37 */
38
39#ifdef CREATE_TRACE_POINTS
40
41/* Prevent recursion */
42#undef CREATE_TRACE_POINTS
43
44#include <linux/stringify.h>
f62b389e 45
3bc29f0a 46#undef LTTNG_TRACEPOINT_EVENT_MAP
f127e61e 47#define LTTNG_TRACEPOINT_EVENT_MAP(name, map, proto, args, fields)
3bc29f0a
MD
48
49#undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
f127e61e 50#define LTTNG_TRACEPOINT_EVENT_MAP_NOARGS(name, map, fields)
76e4f017 51
3bc29f0a
MD
52#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
53#define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, map, proto, args)
76e4f017 54
3bc29f0a 55#undef LTTNG_TRACEPOINT_EVENT
f127e61e 56#define LTTNG_TRACEPOINT_EVENT(name, proto, args, fields)
f62b389e 57
3bc29f0a 58#undef LTTNG_TRACEPOINT_EVENT_CODE
f127e61e 59#define LTTNG_TRACEPOINT_EVENT_CODE(name, proto, args, _locvar, _code, fields)
7ca580f8 60
f127e61e
MD
61#undef LTTNG_TRACEPOINT_EVENT_CODE_MAP
62#define LTTNG_TRACEPOINT_EVENT_CODE_MAP(name, map, proto, args, _locvar, _code, fields)
f62b389e 63
3bc29f0a
MD
64#undef LTTNG_TRACEPOINT_EVENT_INSTANCE
65#define LTTNG_TRACEPOINT_EVENT_INSTANCE(template, name, proto, args)
f62b389e 66
3bc29f0a
MD
67#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
68#define LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name)
f62b389e 69
3bc29f0a
MD
70#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
71#define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(template, name, map)
f62b389e 72
f62b389e
MD
73#undef TRACE_INCLUDE
74#undef __TRACE_INCLUDE
75
76#ifndef TRACE_INCLUDE_FILE
77# define TRACE_INCLUDE_FILE TRACE_SYSTEM
78# define UNDEF_TRACE_INCLUDE_FILE
79#endif
80
81#ifndef TRACE_INCLUDE_PATH
82# define __TRACE_INCLUDE(system) <trace/events/system.h>
83# define UNDEF_TRACE_INCLUDE_PATH
84#else
85# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
86#endif
87
88# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
89
90/* Let the trace headers be reread */
91#define TRACE_HEADER_MULTI_READ
92
93#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
94
95/* Make all open coded DECLARE_TRACE nops */
96#undef DECLARE_TRACE
97#define DECLARE_TRACE(name, proto, args)
98
99#ifdef LTTNG_PACKAGE_BUILD
100#include "lttng-events.h"
101#endif
102
3bc29f0a 103#undef LTTNG_TRACEPOINT_EVENT
3bc29f0a 104#undef LTTNG_TRACEPOINT_EVENT_INSTANCE
3bc29f0a 105#undef LTTNG_TRACEPOINT_EVENT_MAP
3bc29f0a
MD
106#undef LTTNG_TRACEPOINT_EVENT_CLASS
107#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
f127e61e 108#undef LTTNG_TRACEPOINT_EVENT_CODE_MAP
3bc29f0a
MD
109#undef LTTNG_TRACEPOINT_EVENT_CODE
110#undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
111#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
112#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
f62b389e 113#undef TRACE_HEADER_MULTI_READ
f62b389e
MD
114
115/* Only undef what we defined in this file */
116#ifdef UNDEF_TRACE_INCLUDE_FILE
117# undef TRACE_INCLUDE_FILE
118# undef UNDEF_TRACE_INCLUDE_FILE
119#endif
120
121#ifdef UNDEF_TRACE_INCLUDE_PATH
122# undef TRACE_INCLUDE_PATH
123# undef UNDEF_TRACE_INCLUDE_PATH
124#endif
125
3bc29f0a
MD
126/*
127 * We want to re-include lttng-tracepoint-event.h for a following probe.
128 */
129#undef LTTNG_TRACEPOINT_EVENT_H
130
f62b389e
MD
131/* We may be processing more files */
132#define CREATE_TRACE_POINTS
133
134#endif /* CREATE_TRACE_POINTS */
This page took 0.033196 seconds and 4 git commands to generate.