Tracepoint event: Document search paths
[lttng-ust.git] / include / ust / tracepoint-event.h
1 /*
2 * Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation;
8 * version 2.1 of the License.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 *
20 * Trace files that want to automate creationg of all tracepoints defined
21 * in their file should include this file. The following are macros that the
22 * trace file may define:
23 *
24 * TRACEPOINT_SYSTEM defines the system the tracepoint is for:
25 * < [com_company_]project_[component_] >
26 *
27 * TRACEPOINT_INCLUDE_FILE if the file name is something other than
28 * TRACEPOINT_SYSTEM.h. This macro may be defined to tell
29 * define_trace.h what file to include. Note, leave off the ".h".
30 *
31 * TRACEPOINT_INCLUDE_PATH if the path is something other than within
32 * the system's include/tracepoint/ path, then this macro can define
33 * the path to use. This path is relative to tracepoint-event.h, or
34 * to the include search path. Trick: Use a
35 * #define TRACEPOINT_INCLUDE_PATH .
36 * combined with -Ipath_to_header as compiler argument to allow
37 * searching for a header within your project build tree.
38 */
39
40 #ifdef TRACEPOINT_CREATE_PROBES
41
42 /* Prevent recursion */
43 #undef TRACEPOINT_CREATE_PROBES
44
45 #ifndef __tp_stringify
46 #define __tp_stringify_1(x...) #x
47 #define __tp_stringify(x...) __tp_stringify_1(x)
48 #endif
49
50 #undef TRACEPOINT_EVENT
51 #define TRACEPOINT_EVENT(name, proto, args, fields) \
52 _DEFINE_TRACEPOINT(name)
53
54 #undef TRACEPOINT_EVENT_INSTANCE
55 #define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
56 _DEFINE_TRACEPOINT(name)
57
58 #undef TRACEPOINT_EVENT_NOARGS
59 #define TRACEPOINT_EVENT_NOARGS(name, fields) \
60 _DEFINE_TRACEPOINT(name)
61
62 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
63 #define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
64 _DEFINE_TRACEPOINT(name)
65
66 #undef TRACEPOINT_INCLUDE
67 #undef __TRACEPOINT_INCLUDE
68
69 #ifndef TRACEPOINT_INCLUDE_FILE
70 # define TRACEPOINT_INCLUDE_FILE TRACEPOINT_SYSTEM
71 # define UNDEF_TRACEPOINT_INCLUDE_FILE
72 #endif
73
74 #ifndef TRACEPOINT_INCLUDE_PATH
75 # define __TRACEPOINT_INCLUDE(system) <tracepoint/system.h>
76 # define UNDEF_TRACEPOINT_INCLUDE_PATH
77 #else
78 # define __TRACEPOINT_INCLUDE(system) \
79 __tp_stringify(TRACEPOINT_INCLUDE_PATH/system.h)
80 #endif
81
82 # define TRACEPOINT_INCLUDE(system) __TRACEPOINT_INCLUDE(system)
83
84 /* Let the trace headers be reread */
85 #define TRACEPOINT_HEADER_MULTI_READ
86
87 #include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE)
88
89 #include <ust/lttng-tracepoint-event.h>
90
91 #undef TRACEPOINT_EVENT
92 #undef TRACEPOINT_EVENT_CLASS
93 #undef TRACEPOINT_EVENT_INSTANCE
94 #undef TRACEPOINT_EVENT_NOARGS
95 #undef TRACEPOINT_EVENT_CLASS_NOARGS
96 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
97 #undef TRACEPOINT_HEADER_MULTI_READ
98
99 /* Only undef what we defined in this file */
100 #ifdef UNDEF_TRACEPOINT_INCLUDE_FILE
101 # undef TRACEPOINT_INCLUDE_FILE
102 # undef UNDEF_TRACEPOINT_INCLUDE_FILE
103 #endif
104
105 #ifdef UNDEF_TRACEPOINT_INCLUDE_PATH
106 # undef TRACEPOINT_INCLUDE_PATH
107 # undef UNDEF_TRACEPOINT_INCLUDE_PATH
108 #endif
109
110 /* We may be processing more files */
111 #define TRACEPOINT_CREATE_PROBES
112
113 #endif /* TRACEPOINT_CREATE_PROBES */
This page took 0.032598 seconds and 5 git commands to generate.