Tracepoint: evaluate arguments within test block
[lttng-ust.git] / include / lttng / tracepoint.h
CommitLineData
51489cad
MD
1#ifndef _LTTNG_TRACEPOINT_H
2#define _LTTNG_TRACEPOINT_H
f99be407
PMF
3
4/*
e9090899 5 * Copyright (C) 2008-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
1f8b0dff 6 * Copyright (C) 2009 Pierre-Marc Fournier
22d72948 7 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
f99be407 8 *
8fc2d8db
PMF
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
f37142a4
MD
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License.
f99be407 13 *
8fc2d8db 14 * This library is distributed in the hope that it will be useful,
1f8b0dff 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8fc2d8db
PMF
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
1f8b0dff 18 *
8fc2d8db
PMF
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
f99be407
PMF
22 *
23 * Heavily inspired from the Linux Kernel Markers.
f99be407
PMF
24 */
25
b7ea1a1c 26#include <urcu-bp.h>
b0c4126f 27#include <urcu/list.h>
51489cad 28#include <lttng/tracepoint-types.h>
f99be407 29
1ea2c2df
MD
30#ifdef __cplusplus
31extern "C" {
32#endif
33
cc7b66ba
MD
34/*
35 * Tracepoints should be added to the instrumented code using the
36 * "tracepoint()" macro.
37 */
82fa766d
MD
38#define tracepoint(provider, name, args...) \
39 do { \
40 if (caa_unlikely(__tracepoint_##provider##___##name.state)) \
41 __trace_##provider##___##name(args); \
42 } while (0)
cc7b66ba 43
f99be407
PMF
44/*
45 * it_func[0] is never NULL because there is at least one element in the array
46 * when the array itself is non NULL.
47 */
63ef2693 48#define __DO_TRACE(tp, proto, vars) \
f99be407 49 do { \
b979b346
MD
50 struct tracepoint_probe *__tp_it_probe_ptr; \
51 void *__tp_it_func; \
52 void *__tp_cb_data; \
f99be407 53 \
9dec086e 54 rcu_read_lock(); \
b979b346
MD
55 __tp_it_probe_ptr = rcu_dereference((tp)->probes); \
56 if (__tp_it_probe_ptr) { \
f99be407 57 do { \
b979b346
MD
58 __tp_it_func = __tp_it_probe_ptr->func; \
59 __tp_cb_data = __tp_it_probe_ptr->data; \
63ef2693 60 URCU_FORCE_CAST(void(*)(proto), __tp_it_func)(vars); \
b979b346 61 } while ((++__tp_it_probe_ptr)->func); \
f99be407 62 } \
9dec086e 63 rcu_read_unlock(); \
f99be407
PMF
64 } while (0)
65
81614639 66#define TP_PARAMS(args...) args
63ef2693
MD
67#define TP_ARGS(args...) args
68
69/*
70 * TP_ARGS takes tuples of type, argument separated by a comma. It can
71 * take up to 10 tuples (which means that less than 10 tuples is fine
72 * too). Each tuple is also separated by a comma.
73 */
74
75#define TP_COMBINE_TOKENS1(_tokena, _tokenb) _tokena##_tokenb
76#define TP_COMBINE_TOKENS(_tokena, _tokenb) TP_COMBINE_TOKENS1(_tokena, _tokenb)
77
78/* _TP_EVEN* extracts the vars names. */
992abe11 79/* 0 and 1 are for void */
63ef2693 80#define _TP_EVEN0()
992abe11 81#define _TP_EVEN1(a)
63ef2693
MD
82#define _TP_EVEN2(a,b) b
83#define _TP_EVEN4(a,b,c,d) b,d
84#define _TP_EVEN6(a,b,c,d,e,f) b,d,f
85#define _TP_EVEN8(a,b,c,d,e,f,g,h) b,d,f,h
86#define _TP_EVEN10(a,b,c,d,e,f,g,h,i,j) b,d,f,h,j
87#define _TP_EVEN12(a,b,c,d,e,f,g,h,i,j,k,l) b,d,f,h,j,l
88#define _TP_EVEN14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) b,d,f,h,j,l,n
89#define _TP_EVEN16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) b,d,f,h,j,l,n,p
90#define _TP_EVEN18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) b,d,f,h,j,l,n,p,r
91#define _TP_EVEN20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) b,d,f,h,j,l,n,p,r,t
92
992abe11 93/* 0 and 1 are for void */
63ef2693 94#define _TP_EVEN_DATA0() __tp_cb_data
992abe11 95#define _TP_EVEN_DATA1(a) __tp_cb_data
63ef2693
MD
96#define _TP_EVEN_DATA2(a,b) __tp_cb_data,b
97#define _TP_EVEN_DATA4(a,b,c,d) __tp_cb_data,b,d
98#define _TP_EVEN_DATA6(a,b,c,d,e,f) __tp_cb_data,b,d,f
99#define _TP_EVEN_DATA8(a,b,c,d,e,f,g,h) __tp_cb_data,b,d,f,h
100#define _TP_EVEN_DATA10(a,b,c,d,e,f,g,h,i,j) __tp_cb_data,b,d,f,h,j
101#define _TP_EVEN_DATA12(a,b,c,d,e,f,g,h,i,j,k,l) __tp_cb_data,b,d,f,h,j,l
102#define _TP_EVEN_DATA14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) __tp_cb_data,b,d,f,h,j,l,n
103#define _TP_EVEN_DATA16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) __tp_cb_data,b,d,f,h,j,l,n,p
104#define _TP_EVEN_DATA18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) __tp_cb_data,b,d,f,h,j,l,n,p,r
105#define _TP_EVEN_DATA20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) __tp_cb_data,b,d,f,h,j,l,n,p,r,t
106
107/* _TP_SPLIT extracts tuples of type, var */
992abe11 108/* 0 and 1 are for void */
63ef2693 109#define _TP_SPLIT0()
992abe11 110#define _TP_SPLIT1(a)
63ef2693
MD
111#define _TP_SPLIT2(a,b) a b
112#define _TP_SPLIT4(a,b,c,d) a b,c d
113#define _TP_SPLIT6(a,b,c,d,e,f) a b,c d,e f
114#define _TP_SPLIT8(a,b,c,d,e,f,g,h) a b,c d,e f,g h
115#define _TP_SPLIT10(a,b,c,d,e,f,g,h,i,j) a b,c d,e f,g h,i j
116#define _TP_SPLIT12(a,b,c,d,e,f,g,h,i,j,k,l) a b,c d,e f,g h,i j,k l
117#define _TP_SPLIT14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) a b,c d,e f,g h,i j,k l,m n
118#define _TP_SPLIT16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) a b,c d,e f,g h,i j,k l,m n,o p
119#define _TP_SPLIT18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) a b,c d,e f,g h,i j,k l,m n,o p,q r
120#define _TP_SPLIT20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) a b,c d,e f,g h,i j,k l,m n,o p,q r,s t
121
992abe11 122/* 0 and 1 are for void */
63ef2693 123#define _TP_SPLIT_DATA0() void *__tp_cb_data
992abe11 124#define _TP_SPLIT_DATA1(a) void *__tp_cb_data
63ef2693
MD
125#define _TP_SPLIT_DATA2(a,b) void *__tp_cb_data,a b
126#define _TP_SPLIT_DATA4(a,b,c,d) void *__tp_cb_data,a b,c d
127#define _TP_SPLIT_DATA6(a,b,c,d,e,f) void *__tp_cb_data,a b,c d,e f
128#define _TP_SPLIT_DATA8(a,b,c,d,e,f,g,h) void *__tp_cb_data,a b,c d,e f,g h
129#define _TP_SPLIT_DATA10(a,b,c,d,e,f,g,h,i,j) void *__tp_cb_data,a b,c d,e f,g h,i j
130#define _TP_SPLIT_DATA12(a,b,c,d,e,f,g,h,i,j,k,l) void *__tp_cb_data,a b,c d,e f,g h,i j,k l
131#define _TP_SPLIT_DATA14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) void *__tp_cb_data,a b,c d,e f,g h,i j,k l,m n
132#define _TP_SPLIT_DATA16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) void *__tp_cb_data,a b,c d,e f,g h,i j,k l,m n,o p
133#define _TP_SPLIT_DATA18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) void *__tp_cb_data,a b,c d,e f,g h,i j,k l,m n,o p,q r
134#define _TP_SPLIT_DATA20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) void *__tp_cb_data,a b,c d,e f,g h,i j,k l,m n,o p,q r,s t
135
136/* Preprocessor trick to count arguments. Inspired from sdt.h. */
137#define _TP_NARGS(...) __TP_NARGS(__VA_ARGS__, 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
138#define __TP_NARGS(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20, N, ...) N
139#define _TP_PROTO_N(N, ...) \
140 TP_PARAMS(TP_COMBINE_TOKENS(_TP_SPLIT, N)(__VA_ARGS__))
141#define _TP_VARS_N(N, ...) \
142 TP_PARAMS(TP_COMBINE_TOKENS(_TP_EVEN, N)(__VA_ARGS__))
143#define _TP_PROTO_DATA_N(N, ...) \
144 TP_PARAMS(TP_COMBINE_TOKENS(_TP_SPLIT_DATA, N)(__VA_ARGS__))
145#define _TP_VARS_DATA_N(N, ...) \
146 TP_PARAMS(TP_COMBINE_TOKENS(_TP_EVEN_DATA, N)(__VA_ARGS__))
147
148#define _TP_ARGS_PROTO(...) _TP_PROTO_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
149#define _TP_ARGS_VARS(...) _TP_VARS_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
150
151#define _TP_ARGS_PROTO_DATA(...) _TP_PROTO_DATA_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
152#define _TP_ARGS_VARS_DATA(...) _TP_VARS_DATA_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
81614639 153
f99be407
PMF
154/*
155 * Make sure the alignment of the structure in the __tracepoints section will
156 * not add unwanted padding between the beginning of the section and the
157 * structure. Force alignment to the same alignment as the section start.
f99be407 158 */
7083f0fe
MD
159#define __DECLARE_TRACEPOINT(provider, name, proto, args, data_proto, data_args) \
160 extern struct tracepoint __tracepoint_##provider##___##name; \
161 static inline void __trace_##provider##___##name(proto) \
f99be407 162 { \
82fa766d
MD
163 __DO_TRACE(&__tracepoint_##provider##___##name, \
164 TP_PARAMS(data_proto), TP_PARAMS(data_args)); \
f99be407 165 } \
9dec086e 166 static inline int \
7083f0fe 167 __register_trace_##provider##___##name(void (*probe)(data_proto), void *data) \
f99be407 168 { \
7083f0fe 169 return __tracepoint_probe_register(#provider ":" #name, (void *) probe, \
9dec086e 170 data); \
f99be407 171 } \
9dec086e 172 static inline int \
7083f0fe 173 __unregister_trace_##provider##___##name(void (*probe)(data_proto), void *data) \
f99be407 174 { \
7083f0fe 175 return __tracepoint_probe_unregister(#provider ":" #name, (void *) probe, \
9dec086e 176 data); \
f99be407
PMF
177 }
178
63ef2693
MD
179#define _DECLARE_TRACEPOINT(provider, name, args) \
180 __DECLARE_TRACEPOINT(provider, name, _TP_ARGS_PROTO(args), _TP_ARGS_VARS(args), \
181 _TP_ARGS_PROTO_DATA(args), _TP_ARGS_VARS_DATA(args))
9dec086e 182
f99be407 183/*
81614639
MD
184 * __tracepoints_ptrs section is not const (read-only) to let the linker update
185 * the pointer, allowing PIC code.
f99be407 186 */
7083f0fe
MD
187#define _DEFINE_TRACEPOINT(provider, name) \
188 static const char __tpstrtab_##provider##___##name[] \
189 __attribute__((section("__tracepoints_strings"))) = \
190 #provider ":" #name; \
191 struct tracepoint __tracepoint_##provider##___##name \
81614639 192 __attribute__((section("__tracepoints"))) = \
7083f0fe
MD
193 { __tpstrtab_##provider##___##name, 0, NULL }; \
194 static struct tracepoint * __tracepoint_ptr_##provider##___##name \
81614639 195 __attribute__((used, section("__tracepoints_ptrs"))) = \
7083f0fe 196 &__tracepoint_##provider##___##name;
f99be407 197
f99be407 198
7083f0fe
MD
199#define __register_tracepoint(provider, name, probe, data) \
200 __register_trace_##provider##___##name(probe, data)
201#define __unregister_tracepoint(provider, name, probe, data) \
202 __unregister_trace_##provider##___##name(probe, data)
f99be407 203
81614639
MD
204/*
205 * Connect a probe to a tracepoint.
206 * Internal API.
207 */
208extern
209int __tracepoint_probe_register(const char *name, void *probe, void *data);
f99be407
PMF
210
211/*
81614639
MD
212 * Disconnect a probe from a tracepoint.
213 * Internal API.
f99be407 214 */
81614639
MD
215extern
216int __tracepoint_probe_unregister(const char *name, void *probe, void *data);
f99be407 217
81614639
MD
218extern
219int tracepoint_register_lib(struct tracepoint * const *tracepoints_start,
220 int tracepoints_count);
221extern
222int tracepoint_unregister_lib(struct tracepoint * const *tracepoints_start);
872037bb 223
6cdf29f8
MD
224/*
225 * These weak symbols, the constructor, and destructor take care of
226 * registering only _one_ instance of the tracepoints per shared-ojbect
227 * (or for the whole main program).
6cdf29f8
MD
228 */
229extern struct tracepoint * const __start___tracepoints_ptrs[]
230 __attribute__((weak, visibility("hidden")));
231extern struct tracepoint * const __stop___tracepoints_ptrs[]
232 __attribute__((weak, visibility("hidden")));
233int __tracepoint_registered
234 __attribute__((weak, visibility("hidden")));
235
236static void __attribute__((constructor)) __tracepoints__init(void)
237{
238 if (__tracepoint_registered++)
239 return;
240 tracepoint_register_lib(__start___tracepoints_ptrs,
241 __stop___tracepoints_ptrs -
242 __start___tracepoints_ptrs);
243}
244
245static void __attribute__((destructor)) __tracepoints__destroy(void)
246{
247 if (--__tracepoint_registered)
248 return;
249 tracepoint_unregister_lib(__start___tracepoints_ptrs);
250}
22d72948 251
9e0e41bf
MD
252#ifdef __cplusplus
253}
254#endif
255
256#endif /* _LTTNG_TRACEPOINT_H */
257
258/*
259 * For multiple probe generation, we need to redefine TRACEPOINT_EVENT
260 * each time tracepoint.h is included.
261 */
262
8d71973c 263#ifndef TRACEPOINT_EVENT
22d72948 264/*
d75775a6
MD
265 * Usage of the TRACEPOINT_EVENT macro:
266 *
267 * In short, an example:
268 *
7083f0fe 269 * TRACEPOINT_EVENT(< [com_company_]project[_component] >, < event >,
63ef2693
MD
270 *
271 * * TP_ARGS takes from 0 to 10 "type, field_name" pairs *
272 *
273 * TP_ARGS(int, arg0, void *, arg1, char *, string, size_t, strlen,
274 * long *, arg4, size_t, arg4_len),
d75775a6
MD
275 * TP_FIELDS(
276 *
277 * * Integer, printed in base 10 *
278 * ctf_integer(int, field_a, arg0)
279 *
280 * * Integer, printed with 0x base 16 *
281 * ctf_integer_hex(unsigned long, field_d, arg1)
282 *
283 * * Array Sequence, printed as UTF8-encoded array of bytes *
284 * ctf_array_text(char, field_b, string, FIXED_LEN)
285 * ctf_sequence_text(char, field_c, string, size_t, strlen)
286 *
287 * * String, printed as UTF8-encoded string *
288 * ctf_string(field_e, string)
289 *
290 * * Array sequence of signed integer values *
291 * ctf_array(long, field_f, arg4, FIXED_LEN4)
292 * ctf_sequence(long, field_g, arg4, size_t, arg4_len)
293 * )
294 * )
295 *
296 * In more detail:
22d72948 297 *
0a42beb6
MD
298 * We define a tracepoint, its arguments, and its 'fast binary record'
299 * layout.
22d72948 300 *
7083f0fe 301 * Firstly, name your tracepoint via TRACEPOINT_EVENT(provider, name,
22d72948 302 *
7083f0fe
MD
303 * The provider and name should be a proper C99 identifier.
304 * The "provider" and "name" MUST follow these rules to ensure no
305 * namespace clash occurs:
22d72948 306 *
0a42beb6
MD
307 * For projects (applications and libraries) for which an entity
308 * specific to the project controls the source code and thus its
309 * tracepoints (typically with a scope larger than a single company):
22d72948 310 *
0a42beb6 311 * either:
7083f0fe 312 * project_component, event
0a42beb6 313 * or:
7083f0fe 314 * project, event
0a42beb6
MD
315 *
316 * Where "project" is the name of the project,
d5001b43
MD
317 * "component" is the name of the project component (which may
318 * include several levels of sub-components, e.g.
319 * ...component_subcomponent_...) where the tracepoint is located
320 * (optional),
0a42beb6
MD
321 * "event" is the name of the tracepoint event.
322 *
323 * For projects issued from a single company wishing to advertise that
324 * the company controls the source code and thus the tracepoints, the
325 * "com_" prefix should be used:
326 *
327 * either:
7083f0fe 328 * com_company_project_component, event
0a42beb6 329 * or:
7083f0fe 330 * com_company_project, event
0a42beb6
MD
331 *
332 * Where "company" is the name of the company,
333 * "project" is the name of the project,
d5001b43
MD
334 * "component" is the name of the project component (which may
335 * include several levels of sub-components, e.g.
336 * ...component_subcomponent_...) where the tracepoint is located
337 * (optional),
0a42beb6
MD
338 * "event" is the name of the tracepoint event.
339 *
b43de1e7 340 * the provider:event identifier is limited to 127 characters.
0a42beb6
MD
341 *
342 * As an example, let's consider a user-space application "someproject"
343 * that would have an internal thread scheduler:
344 *
7083f0fe 345 * TRACEPOINT_EVENT(someproject_sched, switch,
22d72948
NC
346 *
347 * *
63ef2693
MD
348 * * Arguments to pass to the tracepoint. Supports from
349 * * 0 to 10 "type, name" tuples.
22d72948
NC
350 * *
351 *
63ef2693
MD
352 * TP_ARGS(struct rq *, rq, struct task_struct *, prev,
353 * struct task_struct *, next),
22d72948
NC
354 *
355 * *
356 * * Fast binary tracing: define the trace record via
81614639 357 * * TP_FIELDS(). You can think about it like a
22d72948
NC
358 * * regular C structure local variable definition.
359 * *
360 * * This is how the trace record is structured and will
361 * * be saved into the ring buffer. These are the fields
362 * * that will be exposed to readers.
363 * *
0a42beb6 364 * * ctf_integer(pid_t, prev_pid, prev->pid) is equivalent
81614639 365 * * to a standard declaraton:
22d72948 366 * *
81614639 367 * * pid_t prev_pid;
22d72948 368 * *
81614639 369 * * followed by an assignment:
22d72948 370 * *
81614639 371 * * prev_pid = prev->pid;
22d72948 372 * *
0a42beb6 373 * * ctf_array(char, prev_comm, prev->comm, TASK_COMM_LEN) is
81614639 374 * * equivalent to:
22d72948 375 * *
81614639 376 * * char prev_comm[TASK_COMM_LEN];
22d72948 377 * *
81614639 378 * * followed by an assignment:
22d72948 379 * *
81614639 380 * * memcpy(prev_comm, prev->comm, TASK_COMM_LEN);
22d72948
NC
381 * *
382 *
81614639 383 * TP_FIELDS(
0a42beb6
MD
384 * ctf_array(char, prev_comm, prev->comm, TASK_COMM_LEN)
385 * ctf_integer(pid_t, prev_pid, prev->pid)
386 * ctf_integer(int, prev_prio, prev->prio)
387 * ctf_array(char, next_comm, next->comm, TASK_COMM_LEN)
388 * ctf_integer(pid_t, next_pid, next->pid)
389 * ctf_integer(int, next_prio, next->prio)
22d72948 390 * )
0a42beb6 391 * )
abcdecad
MD
392 *
393 * Do _NOT_ add comma (,) nor semicolon (;) after the TRACEPOINT_EVENT
394 * declaration.
395 *
a4ada9b8 396 * The TRACEPOINT_PROVIDER must be defined when declaring a
abcdecad
MD
397 * TRACEPOINT_EVENT. See ust/tracepoint-event.h for information about
398 * usage of other macros controlling TRACEPOINT_EVENT.
22d72948
NC
399 */
400
63ef2693
MD
401#define TRACEPOINT_EVENT(provider, name, args, fields) \
402 _DECLARE_TRACEPOINT(provider, name, TP_PARAMS(args))
0c0686ee 403
63ef2693
MD
404#define TRACEPOINT_EVENT_CLASS(provider, name, args, fields)
405#define TRACEPOINT_EVENT_INSTANCE(provider, template, name, args)\
406 _DECLARE_TRACEPOINT(provider, name, TP_PARAMS(args))
0c0686ee 407
81614639 408#endif /* #ifndef TRACEPOINT_EVENT */
22d72948 409
abcdecad
MD
410#ifndef TRACEPOINT_LOGLEVEL
411
412/*
413 * Tracepoint Loglevel Declaration Facility
414 *
415 * This is a place-holder the tracepoint loglevel declaration,
416 * overridden by the tracer implementation.
417 *
418 * Typical use of these loglevels:
419 *
420 * 1) Declare the mapping between loglevel names and an integer values
421 * within TRACEPOINT_LOGLEVEL_ENUM, using TP_LOGLEVEL for each tuple.
422 * Do _NOT_ add comma (,) nor semicolon (;) between the
423 * TRACEPOINT_LOGLEVEL_ENUM entries. Do _NOT_ add comma (,) nor
424 * semicolon (;) after the TRACEPOINT_LOGLEVEL_ENUM declaration. The
425 * name should be a proper C99 identifier.
426 *
427 * TRACEPOINT_LOGLEVEL_ENUM(
428 * TP_LOGLEVEL( < loglevel_name >, < value > )
429 * TP_LOGLEVEL( < loglevel_name >, < value > )
430 * ...
431 * )
432 *
433 * e.g.:
434 *
435 * TRACEPOINT_LOGLEVEL_ENUM(
436 * TP_LOGLEVEL(LOG_EMERG, 0)
437 * TP_LOGLEVEL(LOG_ALERT, 1)
438 * TP_LOGLEVEL(LOG_CRIT, 2)
439 * TP_LOGLEVEL(LOG_ERR, 3)
440 * TP_LOGLEVEL(LOG_WARNING, 4)
441 * TP_LOGLEVEL(LOG_NOTICE, 5)
442 * TP_LOGLEVEL(LOG_INFO, 6)
443 * TP_LOGLEVEL(LOG_DEBUG, 7)
444 * )
445 *
e9f37b4c
MD
446 * 2) Then, declare tracepoint loglevels for tracepoints. A
447 * TRACEPOINT_EVENT should be declared prior to the the
448 * TRACEPOINT_LOGLEVEL for a given tracepoint name. The first field
449 * is the name of the tracepoint, the second field is the loglevel
450 * name.
abcdecad 451 *
7083f0fe 452 * TRACEPOINT_LOGLEVEL(< [com_company_]project[_component] >, < event >,
abcdecad
MD
453 * < loglevel_name >)
454 *
a4ada9b8 455 * The TRACEPOINT_PROVIDER must be defined when declaring a
abcdecad 456 * TRACEPOINT_LOGLEVEL_ENUM and TRACEPOINT_LOGLEVEL. The tracepoint
a4ada9b8 457 * loglevel enumeration apply to the entire TRACEPOINT_PROVIDER. Only one
abcdecad 458 * tracepoint loglevel enumeration should be declared per tracepoint
a4ada9b8 459 * provider.
abcdecad
MD
460 */
461
462#define TRACEPOINT_LOGLEVEL_ENUM()
463#define TRACEPOINT_LOGLEVEL(name, loglevel)
464
465#endif /* #ifndef TRACEPOINT_LOGLEVEL */
This page took 0.050531 seconds and 4 git commands to generate.