4 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
5 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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.
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.
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
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:
27 * TRACE_SYSTEM defines the system the tracepoint is for
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".
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.
39 #ifdef CREATE_TRACE_POINTS
41 /* Prevent recursion */
42 #undef CREATE_TRACE_POINTS
44 #include <linux/stringify.h>
46 #undef LTTNG_TRACEPOINT_EVENT_MAP
47 #define LTTNG_TRACEPOINT_EVENT_MAP(name, map, proto, args, fields)
49 #undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
50 #define LTTNG_TRACEPOINT_EVENT_MAP_NOARGS(name, map, fields)
52 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
53 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, map, proto, args)
55 #undef LTTNG_TRACEPOINT_EVENT
56 #define LTTNG_TRACEPOINT_EVENT(name, proto, args, fields)
58 #undef LTTNG_TRACEPOINT_EVENT_CODE
59 #define LTTNG_TRACEPOINT_EVENT_CODE(name, proto, args, _locvar, _code_pre, fields, _code_post)
61 #undef LTTNG_TRACEPOINT_EVENT_CODE_MAP
62 #define LTTNG_TRACEPOINT_EVENT_CODE_MAP(name, map, proto, args, _locvar, _code_pre, fields, _code_post)
64 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE
65 #define LTTNG_TRACEPOINT_EVENT_INSTANCE(template, name, proto, args)
67 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
68 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name)
70 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
71 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(template, name, map)
74 #undef __TRACE_INCLUDE
76 #ifndef TRACE_INCLUDE_FILE
77 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
78 # define UNDEF_TRACE_INCLUDE_FILE
81 #ifndef TRACE_INCLUDE_PATH
82 # define __TRACE_INCLUDE(system) <trace/events/system.h>
83 # define UNDEF_TRACE_INCLUDE_PATH
85 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
88 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
90 /* Let the trace headers be reread */
91 #define TRACE_HEADER_MULTI_READ
93 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
95 /* Make all open coded DECLARE_TRACE nops */
97 #define DECLARE_TRACE(name, proto, args)
99 #ifdef LTTNG_PACKAGE_BUILD
100 #include <probes/lttng-tracepoint-event-impl.h>
103 #undef LTTNG_TRACEPOINT_EVENT
104 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE
105 #undef LTTNG_TRACEPOINT_EVENT_MAP
106 #undef LTTNG_TRACEPOINT_EVENT_CLASS
107 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
108 #undef LTTNG_TRACEPOINT_EVENT_CODE_MAP
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
113 #undef TRACE_HEADER_MULTI_READ
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
121 #ifdef UNDEF_TRACE_INCLUDE_PATH
122 # undef TRACE_INCLUDE_PATH
123 # undef UNDEF_TRACE_INCLUDE_PATH
127 * We want to re-include lttng-tracepoint-event.h for a following probe.
129 #undef LTTNG_TRACEPOINT_EVENT_H
131 /* We may be processing more files */
132 #define CREATE_TRACE_POINTS
134 #endif /* CREATE_TRACE_POINTS */
This page took 0.031738 seconds and 4 git commands to generate.