LGPLv2.1 relicensing agreements
[ust.git] / include / ust / define_trace.h
CommitLineData
22d72948
NC
1/*
2 * Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
f37142a4
MD
6 * License as published by the Free Software Foundation;
7 * version 2.1 of the License.
22d72948
NC
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 *
19 * Trace files that want to automate creationg of all tracepoints defined
20 * in their file should include this file. The following are macros that the
21 * trace file may define:
22 *
23 * TRACE_SYSTEM defines the system the tracepoint is for
24 *
25 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
26 * This macro may be defined to tell define_trace.h what file to include.
27 * Note, leave off the ".h".
28 *
29 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
30 * then this macro can define the path to use. Note, the path is relative to
31 * define_trace.h, not the file including it. Full path names for out of tree
32 * modules must be used.
33 */
34
35#ifdef CREATE_TRACE_POINTS
36
37/* Prevent recursion */
38#undef CREATE_TRACE_POINTS
39
40#include <ust/kcompat/stringify.h>
41
42#undef TRACE_EVENT
43#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
44 DEFINE_TRACE(name)
45
46#undef TRACE_EVENT_FN
47#define TRACE_EVENT_FN(name, proto, args, tstruct, \
48 assign, print, reg, unreg) \
49 DEFINE_TRACE_FN(name, reg, unreg)
50
51#undef DEFINE_TRACE_EVENT
52#define DEFINE_TRACE_EVENT(template, name, proto, args) \
53 DEFINE_TRACE(name)
54
55#undef DEFINE_TRACE_EVENT_PRINT
56#define DEFINE_TRACE_EVENT_PRINT(template, name, proto, args, print) \
57 DEFINE_TRACE(name)
58
59#undef DECLARE_TRACE
60#define DECLARE_TRACE(name, proto, args) \
61 DEFINE_TRACE(name)
62
63#undef TRACE_INCLUDE
64#undef __TRACE_INCLUDE
65
66#ifndef TRACE_INCLUDE_FILE
67# define TRACE_INCLUDE_FILE TRACE_SYSTEM
68# define UNDEF_TRACE_INCLUDE_FILE
69#endif
70
71#ifndef TRACE_INCLUDE_PATH
72# define __TRACE_INCLUDE(system) <trace/events/system.h>
73# define UNDEF_TRACE_INCLUDE_PATH
74#else
75# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
76#endif
77
78# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
79
80/* Let the trace headers be reread */
81#define TRACE_HEADER_MULTI_READ
82
83#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
84
85/* Make all open coded DECLARE_TRACE nops */
86#undef DECLARE_TRACE
87#define DECLARE_TRACE(name, proto, args)
88
89#ifndef CONFIG_NO_EVENT_TRACING
90#include <ust/ust_trace.h>
91#endif
92
93#undef TRACE_EVENT
94#undef TRACE_EVENT_FN
95#undef DECLARE_TRACE_EVENT_CLASS
96#undef DEFINE_TRACE_EVENT
97#undef DEFINE_TRACE_EVENT_PRINT
98#undef TRACE_HEADER_MULTI_READ
99#undef DECLARE_TRACE
100
101/* Only undef what we defined in this file */
102#ifdef UNDEF_TRACE_INCLUDE_FILE
103# undef TRACE_INCLUDE_FILE
104# undef UNDEF_TRACE_INCLUDE_FILE
105#endif
106
107#ifdef UNDEF_TRACE_INCLUDE_PATH
108# undef TRACE_INCLUDE_PATH
109# undef UNDEF_TRACE_INCLUDE_PATH
110#endif
111
112/* We may be processing more files */
113#define CREATE_TRACE_POINTS
114
115#endif /* CREATE_TRACE_POINTS */
This page took 0.030024 seconds and 4 git commands to generate.