Add a version.h header
[ust.git] / include / ust / tracepoint_event.h
... / ...
CommitLineData
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 * TRACE_SYSTEM defines the system the tracepoint is for
25 *
26 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
27 * This macro may be defined to tell define_trace.h what file to include.
28 * Note, leave off the ".h".
29 *
30 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
31 * then this macro can define the path to use. Note, the path is relative to
32 * tracepoint_event.h, not the file including it. Full path names for out of tree
33 * modules must be used.
34 */
35
36#ifdef TRACEPOINT_CREATE_PROBES
37
38/* Prevent recursion */
39#undef TRACEPOINT_CREATE_PROBES
40
41#ifndef __tp_stringify
42#define __tp_stringify_1(x...) #x
43#define __tp_stringify(x...) __tp_stringify_1(x)
44#endif
45
46#undef TRACEPOINT_EVENT
47#define TRACEPOINT_EVENT(name, proto, args, fields) \
48 _DEFINE_TRACEPOINT(name)
49
50#undef TRACEPOINT_EVENT_INSTANCE
51#define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
52 _DEFINE_TRACEPOINT(name)
53
54#undef TRACEPOINT_EVENT_NOARGS
55#define TRACEPOINT_EVENT_NOARGS(name, fields) \
56 _DEFINE_TRACEPOINT(name)
57
58#undef TRACEPOINT_EVENT_INSTANCE_NOARGS
59#define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
60 _DEFINE_TRACEPOINT(name)
61
62#undef TRACE_INCLUDE
63#undef __TRACE_INCLUDE
64
65#ifndef TRACE_INCLUDE_FILE
66# define TRACE_INCLUDE_FILE TRACE_SYSTEM
67# define UNDEF_TRACE_INCLUDE_FILE
68#endif
69
70#ifndef TRACE_INCLUDE_PATH
71# define __TRACE_INCLUDE(system) <trace/events/system.h>
72# define UNDEF_TRACE_INCLUDE_PATH
73#else
74# define __TRACE_INCLUDE(system) __tp_stringify(TRACE_INCLUDE_PATH/system.h)
75#endif
76
77# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
78
79/* Let the trace headers be reread */
80#define TRACE_HEADER_MULTI_READ
81
82#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
83
84#ifndef CONFIG_NO_EVENT_TRACING
85#include <ust/probe.h>
86#endif
87
88#undef TRACEPOINT_EVENT
89#undef TRACEPOINT_EVENT_CLASS
90#undef TRACEPOINT_EVENT_INSTANCE
91#undef TRACEPOINT_EVENT_NOARGS
92#undef TRACEPOINT_EVENT_CLASS_NOARGS
93#undef TRACEPOINT_EVENT_INSTANCE_NOARGS
94#undef TRACE_HEADER_MULTI_READ
95
96/* Only undef what we defined in this file */
97#ifdef UNDEF_TRACE_INCLUDE_FILE
98# undef TRACE_INCLUDE_FILE
99# undef UNDEF_TRACE_INCLUDE_FILE
100#endif
101
102#ifdef UNDEF_TRACE_INCLUDE_PATH
103# undef TRACE_INCLUDE_PATH
104# undef UNDEF_TRACE_INCLUDE_PATH
105#endif
106
107/* We may be processing more files */
108#define TRACEPOINT_CREATE_PROBES
109
110#endif /* TRACEPOINT_CREATE_PROBES */
This page took 0.021834 seconds and 4 git commands to generate.