2 * Copyright (c) 2011-2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 #include <urcu/compiler.h>
25 #include <urcu/rculist.h>
26 #include <lttng/ust-events.h>
27 #include <lttng/ringbuffer-config.h>
28 #include <lttng/ust-compiler.h>
32 * TRACEPOINT_EVENT_CLASS declares a class of tracepoints receiving the
33 * same arguments and having the same field layout.
35 * TRACEPOINT_EVENT_INSTANCE declares an instance of a tracepoint, with
36 * its own provider and name. It refers to a class (template).
38 * TRACEPOINT_EVENT declared both a class and an instance and does a
39 * direct mapping from the instance to the class.
42 #undef TRACEPOINT_EVENT
43 #define TRACEPOINT_EVENT(_provider, _name, _args, _fields) \
44 TRACEPOINT_EVENT_CLASS(_provider, _name, \
46 _TP_PARAMS(_fields)) \
47 TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name, \
51 #define _TP_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
53 #define _tp_max_t(type, x, y) \
57 __max1 > __max2 ? __max1: __max2; \
61 * Stage 0 of tracepoint event generation.
63 * Check that each TRACEPOINT_EVENT provider argument match the
64 * TRACEPOINT_PROVIDER by creating dummy callbacks.
67 /* Reset all macros within TRACEPOINT_EVENT */
68 #include <lttng/ust-tracepoint-event-reset.h>
71 void _TP_COMBINE_TOKENS(__tracepoint_provider_mismatch_
, TRACEPOINT_PROVIDER
)(void)
75 #undef TRACEPOINT_EVENT_CLASS
76 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
77 __tracepoint_provider_mismatch_##_provider();
79 #undef TRACEPOINT_EVENT_INSTANCE
80 #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
81 __tracepoint_provider_mismatch_##_provider();
84 void _TP_COMBINE_TOKENS(__tracepoint_provider_check_
, TRACEPOINT_PROVIDER
)(void)
86 #include TRACEPOINT_INCLUDE
90 * Stage 0.1 of tracepoint event generation.
92 * Check that each TRACEPOINT_EVENT provider:name does not exceed the
93 * tracepoint name length limit.
96 /* Reset all macros within TRACEPOINT_EVENT */
97 #include <lttng/ust-tracepoint-event-reset.h>
99 #undef TRACEPOINT_EVENT_INSTANCE
100 #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
102 __tp_name_len_check##_provider##___##_name[LTTNG_UST_SYM_NAME_LEN] \
103 __attribute__((unused)) = \
104 #_provider ":" #_name;
106 #include TRACEPOINT_INCLUDE
109 * Stage 1 of tracepoint event generation.
111 * Create event field type metadata section.
112 * Each event produce an array of fields.
115 /* Reset all macros within TRACEPOINT_EVENT */
116 #include <lttng/ust-tracepoint-event-reset.h>
117 #include <lttng/ust-tracepoint-event-write.h>
118 #include <lttng/ust-tracepoint-event-nowrite.h>
120 #undef _ctf_integer_ext
121 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \
124 .type = __type_integer(_type, _byte_order, _base, none),\
125 .nowrite = _nowrite, \
129 #define _ctf_float(_type, _item, _src, _nowrite) \
132 .type = __type_float(_type), \
133 .nowrite = _nowrite, \
136 #undef _ctf_array_encoded
137 #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
142 .atype = atype_array, \
146 .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
149 .nowrite = _nowrite, \
152 #undef _ctf_sequence_encoded
153 #define _ctf_sequence_encoded(_type, _item, _src, \
154 _length_type, _src_length, _encoding, _nowrite) \
159 .atype = atype_sequence, \
162 .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \
163 .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
166 .nowrite = _nowrite, \
170 #define _ctf_string(_item, _src, _nowrite) \
175 .atype = atype_string, \
176 .u.basic.string.encoding = lttng_encode_UTF8, \
178 .nowrite = _nowrite, \
182 #define TP_FIELDS(...) __VA_ARGS__ /* Only one used in this phase */
184 #undef TRACEPOINT_EVENT_CLASS
185 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
186 static const struct lttng_event_field __event_fields___##_provider##___##_name[] = { \
190 #include TRACEPOINT_INCLUDE
193 * Stage 2 of tracepoint event generation.
195 * Create probe callback prototypes.
198 /* Reset all macros within TRACEPOINT_EVENT */
199 #include <lttng/ust-tracepoint-event-reset.h>
202 #define TP_ARGS(...) __VA_ARGS__
204 #undef TRACEPOINT_EVENT_CLASS
205 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
206 static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
208 #include TRACEPOINT_INCLUDE
211 * Stage 3 of tracepoint event generation.
213 * Create static inline function that calculates event size.
216 /* Reset all macros within TRACEPOINT_EVENT */
217 #include <lttng/ust-tracepoint-event-reset.h>
218 #include <lttng/ust-tracepoint-event-write.h>
220 #undef _ctf_integer_ext
221 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \
222 __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
223 __event_len += sizeof(_type);
226 #define _ctf_float(_type, _item, _src, _nowrite) \
227 __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
228 __event_len += sizeof(_type);
230 #undef _ctf_array_encoded
231 #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
232 __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
233 __event_len += sizeof(_type) * (_length);
235 #undef _ctf_sequence_encoded
236 #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
237 _src_length, _encoding, _nowrite) \
238 __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_length_type)); \
239 __event_len += sizeof(_length_type); \
240 __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
241 __dynamic_len[__dynamic_len_idx] = (_src_length); \
242 __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \
246 #define _ctf_string(_item, _src, _nowrite) \
247 __event_len += __dynamic_len[__dynamic_len_idx++] = strlen(_src) + 1;
250 #define TP_ARGS(...) __VA_ARGS__
253 #define TP_FIELDS(...) __VA_ARGS__
255 #undef TRACEPOINT_EVENT_CLASS
256 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
257 static inline lttng_ust_notrace \
258 size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS_DATA_PROTO(_args)); \
260 size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS_DATA_PROTO(_args)) \
262 size_t __event_len = 0; \
263 unsigned int __dynamic_len_idx = 0; \
266 (void) __dynamic_len_idx; /* don't warn if unused */ \
268 return __event_len; \
271 #include TRACEPOINT_INCLUDE
274 * Stage 3.1 of tracepoint event generation.
276 * Create static inline function that layout the filter stack data.
277 * We make both write and nowrite data available to the filter.
280 /* Reset all macros within TRACEPOINT_EVENT */
281 #include <lttng/ust-tracepoint-event-reset.h>
282 #include <lttng/ust-tracepoint-event-write.h>
283 #include <lttng/ust-tracepoint-event-nowrite.h>
285 #undef _ctf_integer_ext
286 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \
287 if (lttng_is_signed_type(_type)) { \
288 int64_t __ctf_tmp_int64 = (int64_t) (_type) (_src); \
289 memcpy(__stack_data, &__ctf_tmp_int64, sizeof(int64_t)); \
291 uint64_t __ctf_tmp_uint64 = (uint64_t) (_type) (_src); \
292 memcpy(__stack_data, &__ctf_tmp_uint64, sizeof(uint64_t)); \
294 __stack_data += sizeof(int64_t);
297 #define _ctf_float(_type, _item, _src, _nowrite) \
299 double __ctf_tmp_double = (double) (_type) (_src); \
300 memcpy(__stack_data, &__ctf_tmp_double, sizeof(double)); \
301 __stack_data += sizeof(double); \
304 #undef _ctf_array_encoded
305 #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
307 unsigned long __ctf_tmp_ulong = (unsigned long) (_length); \
308 const void *__ctf_tmp_ptr = (_src); \
309 memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
310 __stack_data += sizeof(unsigned long); \
311 memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **)); \
312 __stack_data += sizeof(void **); \
315 #undef _ctf_sequence_encoded
316 #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
317 _src_length, _encoding, _nowrite) \
319 unsigned long __ctf_tmp_ulong = (unsigned long) (_src_length); \
320 const void *__ctf_tmp_ptr = (_src); \
321 memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
322 __stack_data += sizeof(unsigned long); \
323 memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **)); \
324 __stack_data += sizeof(void **); \
328 #define _ctf_string(_item, _src, _nowrite) \
330 const void *__ctf_tmp_ptr = (_src); \
331 memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **)); \
332 __stack_data += sizeof(void **); \
336 #define TP_ARGS(...) __VA_ARGS__
339 #define TP_FIELDS(...) __VA_ARGS__
341 #undef TRACEPOINT_EVENT_CLASS
342 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
344 void __event_prepare_filter_stack__##_provider##___##_name(char *__stack_data,\
345 _TP_ARGS_DATA_PROTO(_args)) \
350 #include TRACEPOINT_INCLUDE
355 * Stage 4 of tracepoint event generation.
357 * Create static inline function that calculates event payload alignment.
360 /* Reset all macros within TRACEPOINT_EVENT */
361 #include <lttng/ust-tracepoint-event-reset.h>
362 #include <lttng/ust-tracepoint-event-write.h>
364 #undef _ctf_integer_ext
365 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \
366 __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
369 #define _ctf_float(_type, _item, _src, _nowrite) \
370 __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
372 #undef _ctf_array_encoded
373 #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
374 __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
376 #undef _ctf_sequence_encoded
377 #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
378 _src_length, _encoding, _nowrite) \
379 __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_length_type)); \
380 __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
383 #define _ctf_string(_item, _src, _nowrite)
386 #define TP_ARGS(...) __VA_ARGS__
389 #define TP_FIELDS(...) __VA_ARGS__
391 #undef TRACEPOINT_EVENT_CLASS
392 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
393 static inline lttng_ust_notrace \
394 size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)); \
396 size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \
398 size_t __event_align = 1; \
400 return __event_align; \
403 #include TRACEPOINT_INCLUDE
407 * Stage 5 of tracepoint event generation.
409 * Create the probe function. This function calls event size calculation
410 * and writes event data into the buffer.
413 /* Reset all macros within TRACEPOINT_EVENT */
414 #include <lttng/ust-tracepoint-event-reset.h>
415 #include <lttng/ust-tracepoint-event-write.h>
417 #undef _ctf_integer_ext
418 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \
420 _type __tmp = (_src); \
421 lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\
422 __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\
426 #define _ctf_float(_type, _item, _src, _nowrite) \
428 _type __tmp = (_src); \
429 lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\
430 __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\
433 #undef _ctf_array_encoded
434 #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
435 lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
436 __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length));
438 #undef _ctf_sequence_encoded
439 #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
440 _src_length, _encoding, _nowrite) \
442 _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx]; \
443 lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
444 __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
446 lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
447 __chan->ops->event_write(&__ctx, _src, \
448 sizeof(_type) * __get_dynamic_len(dest));
451 #define _ctf_string(_item, _src, _nowrite) \
452 lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(*(_src))); \
453 __chan->ops->event_write(&__ctx, _src, __get_dynamic_len(dest));
455 /* Beware: this get len actually consumes the len value */
456 #undef __get_dynamic_len
457 #define __get_dynamic_len(field) __stackvar.__dynamic_len[__dynamic_len_idx++]
460 #define TP_ARGS(...) __VA_ARGS__
463 #define TP_FIELDS(...) __VA_ARGS__
466 * Using twice size for filter stack data to hold size and pointer for
467 * each field (worse case). For integers, max size required is 64-bit.
468 * Same for double-precision floats. Those fit within
469 * 2*sizeof(unsigned long) for all supported architectures.
470 * Perform UNION (||) of filter runtime list.
472 #undef TRACEPOINT_EVENT_CLASS
473 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
474 static lttng_ust_notrace \
475 void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); \
477 void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \
479 struct lttng_event *__event = __tp_data; \
480 struct lttng_channel *__chan = __event->chan; \
481 struct lttng_ust_lib_ring_buffer_ctx __ctx; \
482 size_t __event_len, __event_align; \
483 size_t __dynamic_len_idx = 0; \
485 size_t __dynamic_len[_TP_ARRAY_SIZE(__event_fields___##_provider##___##_name)]; \
486 char __filter_stack_data[2 * sizeof(unsigned long) * _TP_ARRAY_SIZE(__event_fields___##_provider##___##_name)]; \
491 (void) __dynamic_len_idx; /* don't warn if unused */ \
492 if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \
494 if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \
496 if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \
498 if (caa_unlikely(!cds_list_empty(&__event->bytecode_runtime_head))) { \
499 struct lttng_bytecode_runtime *bc_runtime; \
500 int __filter_record = __event->has_enablers_without_bytecode; \
502 __event_prepare_filter_stack__##_provider##___##_name(__stackvar.__filter_stack_data, \
503 _TP_ARGS_DATA_VAR(_args)); \
504 cds_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \
505 if (caa_unlikely(bc_runtime->filter(bc_runtime, \
506 __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \
507 __filter_record = 1; \
509 if (caa_likely(!__filter_record)) \
512 __event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
513 _TP_ARGS_DATA_VAR(_args)); \
514 __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
515 lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \
516 __event_align, -1, __chan->handle); \
517 __ret = __chan->ops->event_reserve(&__ctx, __event->id); \
521 __chan->ops->event_commit(&__ctx); \
524 #include TRACEPOINT_INCLUDE
526 #undef __get_dynamic_len
529 * Stage 5.1 of tracepoint event generation.
531 * Create probe signature
534 /* Reset all macros within TRACEPOINT_EVENT */
535 #include <lttng/ust-tracepoint-event-reset.h>
538 #define TP_ARGS(...) __VA_ARGS__
540 #define _TP_EXTRACT_STRING2(...) #__VA_ARGS__
542 #undef TRACEPOINT_EVENT_CLASS
543 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
544 const char __tp_event_signature___##_provider##___##_name[] = \
545 _TP_EXTRACT_STRING2(_args);
547 #include TRACEPOINT_INCLUDE
549 #undef _TP_EXTRACT_STRING2
552 * Stage 6 of tracepoint event generation.
554 * Tracepoint loglevel mapping definition generation. We generate a
555 * symbol for each mapping for a provider/event to ensure at most a 1 to
556 * 1 mapping between events and loglevels. If the symbol is repeated,
557 * the compiler will complain.
560 /* Reset all macros within TRACEPOINT_EVENT */
561 #include <lttng/ust-tracepoint-event-reset.h>
563 #undef TRACEPOINT_LOGLEVEL
564 #define TRACEPOINT_LOGLEVEL(__provider, __name, __loglevel) \
565 static const int _loglevel_value___##__provider##___##__name = __loglevel; \
566 static const int *_loglevel___##__provider##___##__name = \
567 &_loglevel_value___##__provider##___##__name;
569 #include TRACEPOINT_INCLUDE
572 * Stage 6.1 of tracepoint event generation.
574 * Tracepoint UML URI info.
577 /* Reset all macros within TRACEPOINT_EVENT */
578 #include <lttng/ust-tracepoint-event-reset.h>
580 #undef TRACEPOINT_MODEL_EMF_URI
581 #define TRACEPOINT_MODEL_EMF_URI(__provider, __name, __uri) \
582 static const char *_model_emf_uri___##__provider##___##__name = __uri;
584 #include TRACEPOINT_INCLUDE
587 * Stage 7.1 of tracepoint event generation.
589 * Create events description structures. We use a weakref because
590 * loglevels are optional. If not declared, the event will point to the
591 * a loglevel that contains NULL.
594 /* Reset all macros within TRACEPOINT_EVENT */
595 #include <lttng/ust-tracepoint-event-reset.h>
597 #undef TRACEPOINT_EVENT_INSTANCE
598 #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
600 __ref_loglevel___##_provider##___##_name \
601 __attribute__((weakref ("_loglevel___" #_provider "___" #_name))); \
602 static const char * \
603 __ref_model_emf_uri___##_provider##___##_name \
604 __attribute__((weakref ("_model_emf_uri___" #_provider "___" #_name)));\
605 const struct lttng_event_desc __event_desc___##_provider##_##_name = { \
606 .fields = __event_fields___##_provider##___##_template, \
607 .name = #_provider ":" #_name, \
608 .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\
609 .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \
610 .loglevel = &__ref_loglevel___##_provider##___##_name, \
611 .signature = __tp_event_signature___##_provider##___##_template, \
612 .u.ext.model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \
615 #include TRACEPOINT_INCLUDE
618 * Stage 7.2 of tracepoint event generation.
620 * Create array of events.
623 /* Reset all macros within TRACEPOINT_EVENT */
624 #include <lttng/ust-tracepoint-event-reset.h>
626 #undef TRACEPOINT_EVENT_INSTANCE
627 #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
628 &__event_desc___##_provider##_##_name,
630 static const struct lttng_event_desc
*_TP_COMBINE_TOKENS(__event_desc___
, TRACEPOINT_PROVIDER
)[] = {
631 #include TRACEPOINT_INCLUDE
636 * Stage 8 of tracepoint event generation.
638 * Create a toplevel descriptor for the whole probe.
641 /* non-const because list head will be modified when registered. */
642 static struct lttng_probe_desc
_TP_COMBINE_TOKENS(__probe_desc___
, TRACEPOINT_PROVIDER
) = {
643 .provider
= __tp_stringify(TRACEPOINT_PROVIDER
),
644 .event_desc
= _TP_COMBINE_TOKENS(__event_desc___
, TRACEPOINT_PROVIDER
),
645 .nr_events
= _TP_ARRAY_SIZE(_TP_COMBINE_TOKENS(__event_desc___
, TRACEPOINT_PROVIDER
)),
649 * Stage 9 of tracepoint event generation.
651 * Register/unregister probes at module load/unload.
653 * Generate the constructor as an externally visible symbol for use when
654 * linking the probe statically.
657 /* Reset all macros within TRACEPOINT_EVENT */
658 #include <lttng/ust-tracepoint-event-reset.h>
659 static void lttng_ust_notrace
__attribute__((constructor
))
660 _TP_COMBINE_TOKENS(__lttng_events_init__
, TRACEPOINT_PROVIDER
)(void);
662 _TP_COMBINE_TOKENS(__lttng_events_init__
, TRACEPOINT_PROVIDER
)(void)
667 * __tracepoint_provider_check_ ## TRACEPOINT_PROVIDER() is a
668 * static inline function that ensures every probe PROVIDER
669 * argument match the provider within which they appear. It
670 * calls empty static inline functions, and therefore has no
671 * runtime effect. However, if it detects an error, a linker
674 _TP_COMBINE_TOKENS(__tracepoint_provider_check_
, TRACEPOINT_PROVIDER
)();
675 ret
= lttng_probe_register(&_TP_COMBINE_TOKENS(__probe_desc___
, TRACEPOINT_PROVIDER
));
679 static void lttng_ust_notrace
__attribute__((destructor
))
680 _TP_COMBINE_TOKENS(__lttng_events_exit__
, TRACEPOINT_PROVIDER
)(void);
682 _TP_COMBINE_TOKENS(__lttng_events_exit__
, TRACEPOINT_PROVIDER
)(void)
684 lttng_probe_unregister(&_TP_COMBINE_TOKENS(__probe_desc___
, TRACEPOINT_PROVIDER
));
687 int _TP_COMBINE_TOKENS(__tracepoint_provider_
, TRACEPOINT_PROVIDER
);