1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
5 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
6 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 * Trace files that want to automate creationg of all tracepoints defined
11 * in their file should include this file. The following are macros that the
12 * trace file may define:
14 * TRACE_SYSTEM defines the system the tracepoint is for
16 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
17 * This macro may be defined to tell define_trace.h what file to include.
18 * Note, leave off the ".h".
20 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
21 * then this macro can define the path to use. Note, the path is relative to
22 * define_trace.h, not the file including it. Full path names for out of tree
23 * modules must be used.
26 #ifdef CREATE_TRACE_POINTS
28 /* Prevent recursion */
29 #undef CREATE_TRACE_POINTS
31 #include <linux/stringify.h>
33 #undef LTTNG_TRACEPOINT_EVENT_MAP
34 #define LTTNG_TRACEPOINT_EVENT_MAP(name, map, proto, args, fields)
36 #undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
37 #define LTTNG_TRACEPOINT_EVENT_MAP_NOARGS(name, map, fields)
39 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
40 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, map, proto, args)
42 #undef LTTNG_TRACEPOINT_EVENT
43 #define LTTNG_TRACEPOINT_EVENT(name, proto, args, fields)
45 #undef LTTNG_TRACEPOINT_EVENT_CODE
46 #define LTTNG_TRACEPOINT_EVENT_CODE(name, proto, args, _locvar, _code_pre, fields, _code_post)
48 #undef LTTNG_TRACEPOINT_EVENT_CODE_MAP
49 #define LTTNG_TRACEPOINT_EVENT_CODE_MAP(name, map, proto, args, _locvar, _code_pre, fields, _code_post)
51 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE
52 #define LTTNG_TRACEPOINT_EVENT_INSTANCE(template, name, proto, args)
54 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
55 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name)
57 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
58 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(template, name, map)
61 #undef __TRACE_INCLUDE
63 #ifndef TRACE_INCLUDE_FILE
64 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
65 # define UNDEF_TRACE_INCLUDE_FILE
68 #ifndef TRACE_INCLUDE_PATH
69 # define __TRACE_INCLUDE(system) <trace/events/system.h>
70 # define UNDEF_TRACE_INCLUDE_PATH
72 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
75 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
77 /* Let the trace headers be reread */
78 #define TRACE_HEADER_MULTI_READ
80 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
82 /* Make all open coded DECLARE_TRACE nops */
84 #define DECLARE_TRACE(name, proto, args)
86 #ifdef LTTNG_PACKAGE_BUILD
87 #include <lttng/tracepoint-event-impl.h>
90 #undef LTTNG_TRACEPOINT_EVENT
91 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE
92 #undef LTTNG_TRACEPOINT_EVENT_MAP
93 #undef LTTNG_TRACEPOINT_EVENT_CLASS
94 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
95 #undef LTTNG_TRACEPOINT_EVENT_CODE_MAP
96 #undef LTTNG_TRACEPOINT_EVENT_CODE
97 #undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
98 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
99 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
100 #undef TRACE_HEADER_MULTI_READ
102 /* Only undef what we defined in this file */
103 #ifdef UNDEF_TRACE_INCLUDE_FILE
104 # undef TRACE_INCLUDE_FILE
105 # undef UNDEF_TRACE_INCLUDE_FILE
108 #ifdef UNDEF_TRACE_INCLUDE_PATH
109 # undef TRACE_INCLUDE_PATH
110 # undef UNDEF_TRACE_INCLUDE_PATH
114 * We want to re-include lttng-tracepoint-event.h for a following probe.
116 #undef LTTNG_TRACEPOINT_EVENT_H
118 /* We may be processing more files */
119 #define CREATE_TRACE_POINTS
121 #endif /* CREATE_TRACE_POINTS */
This page took 0.031739 seconds and 4 git commands to generate.