#undef LTTNG_UST_TRACEPOINT_EVENT
#define LTTNG_UST_TRACEPOINT_EVENT(_provider, _name, _args, _fields) \
- LTTNG_UST_TRACEPOINT_EVENT_CLASS(_provider, _name, _TP_PARAMS(_args), \
- _TP_PARAMS(_fields)) \
+ LTTNG_UST_TRACEPOINT_EVENT_CLASS(_provider, _name, LTTNG_UST__TP_PARAMS(_args), \
+ LTTNG_UST__TP_PARAMS(_fields)) \
LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name, \
- _TP_PARAMS(_args))
+ LTTNG_UST__TP_PARAMS(_args))
#undef TRACEPOINT_CREATE_PROBES
#undef LTTNG_UST_TRACEPOINT_EVENT
#define LTTNG_UST_TRACEPOINT_EVENT(provider, name, args, fields) \
- LTTNG_UST__DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args)) \
- LTTNG_UST__DEFINE_TRACEPOINT(provider, name, _TP_PARAMS(args))
+ LTTNG_UST__DECLARE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args)) \
+ LTTNG_UST__DEFINE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args))
#undef LTTNG_UST_TRACEPOINT_EVENT_CLASS
#define LTTNG_UST_TRACEPOINT_EVENT_CLASS(provider, name, args, fields)
#undef LTTNG_UST_TRACEPOINT_EVENT_INSTANCE
#define LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(provider, _template, name, args) \
- LTTNG_UST__DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args)) \
- LTTNG_UST__DEFINE_TRACEPOINT(provider, name, _TP_PARAMS(args))
+ LTTNG_UST__DECLARE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args)) \
+ LTTNG_UST__DEFINE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args))
#undef TRACEPOINT_LOGLEVEL
#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
#define LTTNG_UST__TP_EXDATA_PROTO20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) void *__tp_data,a b,c d,e f,g h,i j,k l,m n,o p,q r,s t
/* Preprocessor trick to count arguments. Inspired from sdt.h. */
-#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)
-#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
-#define _TP_PROTO_N(N, ...) _TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXPROTO, N)(__VA_ARGS__))
-#define _TP_VAR_N(N, ...) _TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXVAR, N)(__VA_ARGS__))
-#define _TP_DATA_PROTO_N(N, ...) _TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXDATA_PROTO, N)(__VA_ARGS__))
-#define _TP_DATA_VAR_N(N, ...) _TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXDATA_VAR, N)(__VA_ARGS__))
-#define _TP_ARGS_PROTO(...) _TP_PROTO_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
-#define _TP_ARGS_VAR(...) _TP_VAR_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
-#define _TP_ARGS_DATA_PROTO(...) _TP_DATA_PROTO_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
-#define _TP_ARGS_DATA_VAR(...) _TP_DATA_VAR_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
-#define _TP_PARAMS(...) __VA_ARGS__
+#define LTTNG_UST__TP_NARGS(...) LTTNG_UST___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)
+#define LTTNG_UST___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
+#define LTTNG_UST__TP_PROTO_N(N, ...) LTTNG_UST__TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXPROTO, N)(__VA_ARGS__))
+#define LTTNG_UST__TP_VAR_N(N, ...) LTTNG_UST__TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXVAR, N)(__VA_ARGS__))
+#define LTTNG_UST__TP_DATA_PROTO_N(N, ...) LTTNG_UST__TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXDATA_PROTO, N)(__VA_ARGS__))
+#define LTTNG_UST__TP_DATA_VAR_N(N, ...) LTTNG_UST__TP_PARAMS(LTTNG_UST__TP_COMBINE_TOKENS(LTTNG_UST__TP_EXDATA_VAR, N)(__VA_ARGS__))
+#define LTTNG_UST__TP_ARGS_PROTO(...) LTTNG_UST__TP_PROTO_N(LTTNG_UST__TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
+#define LTTNG_UST__TP_ARGS_VAR(...) LTTNG_UST__TP_VAR_N(LTTNG_UST__TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
+#define LTTNG_UST__TP_ARGS_DATA_PROTO(...) LTTNG_UST__TP_DATA_PROTO_N(LTTNG_UST__TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
+#define LTTNG_UST__TP_ARGS_DATA_VAR(...) LTTNG_UST__TP_DATA_VAR_N(LTTNG_UST__TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
+#define LTTNG_UST__TP_PARAMS(...) __VA_ARGS__
/*
* sizeof(#_provider) - 1 : length of the provider string (excluding \0).
#define LTTNG_UST__DECLARE_TRACEPOINT(_provider, _name, ...) \
extern struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name; \
static inline \
-void lttng_ust_tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \
+void lttng_ust_tracepoint_cb_##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(__VA_ARGS__)) \
__attribute__((always_inline, unused)) lttng_ust_notrace; \
static \
-void lttng_ust_tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \
+void lttng_ust_tracepoint_cb_##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(__VA_ARGS__)) \
{ \
struct lttng_ust_tracepoint_probe *__tp_probe; \
\
void (*__tp_cb)(void) = __tp_probe->func; \
void *__tp_data = __tp_probe->data; \
\
- URCU_FORCE_CAST(void (*)(_TP_ARGS_DATA_PROTO(__VA_ARGS__)), __tp_cb) \
- (_TP_ARGS_DATA_VAR(__VA_ARGS__)); \
+ URCU_FORCE_CAST(void (*)(LTTNG_UST__TP_ARGS_DATA_PROTO(__VA_ARGS__)), __tp_cb) \
+ (LTTNG_UST__TP_ARGS_DATA_VAR(__VA_ARGS__)); \
} while ((++__tp_probe)->func); \
end: \
tp_rcu_read_unlock(); \
*/
#define LTTNG_UST_TRACEPOINT_EVENT(provider, name, args, fields) \
- LTTNG_UST__DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args)) \
- LTTNG_UST__DEFINE_TRACEPOINT(provider, name, _TP_PARAMS(args))
+ LTTNG_UST__DECLARE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args)) \
+ LTTNG_UST__DEFINE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args))
#define LTTNG_UST_TRACEPOINT_EVENT_CLASS(provider, name, args, fields)
#define LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(provider, _template, name, args) \
- LTTNG_UST__DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args)) \
- LTTNG_UST__DEFINE_TRACEPOINT(provider, name, _TP_PARAMS(args))
+ LTTNG_UST__DECLARE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args)) \
+ LTTNG_UST__DEFINE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args))
#if LTTNG_UST_COMPAT_API(0)
#define TRACEPOINT_EVENT LTTNG_UST_TRACEPOINT_EVENT
#undef LTTNG_UST_TRACEPOINT_EVENT
#define LTTNG_UST_TRACEPOINT_EVENT(_provider, _name, _args, _fields) \
LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, \
- _TP_PARAMS(_args), \
- _TP_PARAMS(_fields)) \
+ LTTNG_UST__TP_PARAMS(_args), \
+ LTTNG_UST__TP_PARAMS(_fields)) \
LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name, \
- _TP_PARAMS(_args))
+ LTTNG_UST__TP_PARAMS(_args))
#undef LTTNG_UST_TRACEPOINT_EVENT_CLASS
#define LTTNG_UST_TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
- LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _TP_PARAMS(_args), _TP_PARAMS(_fields))
+ LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, LTTNG_UST__TP_PARAMS(_args), LTTNG_UST__TP_PARAMS(_fields))
#undef LTTNG_UST_TRACEPOINT_EVENT_INSTANCE
#define LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
- LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _TP_PARAMS(_args))
+ LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, LTTNG_UST__TP_PARAMS(_args))
/* Helpers */
#define _TP_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#undef LTTNG_UST__TRACEPOINT_EVENT_INSTANCE
#define LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
-void __event_template_proto___##_provider##___##_template(_TP_ARGS_DATA_PROTO(_args));
+void __event_template_proto___##_provider##___##_template(LTTNG_UST__TP_ARGS_DATA_PROTO(_args));
#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
-void __event_template_proto___##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
+void __event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PROTO(_args));
#include TRACEPOINT_INCLUDE
#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
-static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
+static void __event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PROTO(_args));
#include TRACEPOINT_INCLUDE
#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
static inline \
-size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS_DATA_PROTO(_args)) \
+size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, LTTNG_UST__TP_ARGS_DATA_PROTO(_args)) \
lttng_ust_notrace; \
static inline \
size_t __event_get_size__##_provider##___##_name( \
size_t *__dynamic_len __attribute__((__unused__)), \
- _TP_ARGS_DATA_PROTO(_args)) \
+ LTTNG_UST__TP_ARGS_DATA_PROTO(_args)) \
{ \
size_t __event_len = 0; \
unsigned int __dynamic_len_idx __attribute__((__unused__)) = 0; \
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
static inline \
void __event_prepare_interpreter_stack__##_provider##___##_name(char *__stack_data,\
- _TP_ARGS_DATA_PROTO(_args)) \
+ LTTNG_UST__TP_ARGS_DATA_PROTO(_args)) \
{ \
if (0) { \
(void) __tp_data; /* don't warn if unused */ \
#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
static inline \
-size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \
+size_t __event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(_args)) \
lttng_ust_notrace; \
static inline \
-size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \
+size_t __event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(_args)) \
{ \
size_t __event_align = 1; \
_fields \
#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
static \
-void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \
+void __event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PROTO(_args)) \
lttng_ust_notrace; \
static \
-void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \
+void __event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PROTO(_args)) \
{ \
struct lttng_ust_event_common *__event = (struct lttng_ust_event_common *) __tp_data; \
size_t __dynamic_len_idx = 0; \
return; \
if (caa_unlikely(CMM_ACCESS_ONCE(__event->eval_filter))) { \
__event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
- _TP_ARGS_DATA_VAR(_args)); \
+ LTTNG_UST__TP_ARGS_DATA_VAR(_args)); \
__interpreter_stack_prepared = true; \
if (caa_likely(__event->run_filter(__event, \
__stackvar.__interpreter_stack_data, NULL) != LTTNG_UST_EVENT_FILTER_ACCEPT)) \
struct lttng_ust_ring_buffer_ctx __ctx; \
\
__event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
- _TP_ARGS_DATA_VAR(_args)); \
- __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
+ LTTNG_UST__TP_ARGS_DATA_VAR(_args)); \
+ __event_align = __event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_VAR(_args)); \
lttng_ust_ring_buffer_ctx_init(&__ctx, __event_recorder, __event_len, __event_align, \
_TP_IP_PARAM(TP_IP_PARAM)); \
__ret = __chan->ops->event_reserve(&__ctx); \
\
if (caa_unlikely(!__interpreter_stack_prepared && __notif_ctx.eval_capture)) \
__event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
- _TP_ARGS_DATA_VAR(_args)); \
+ LTTNG_UST__TP_ARGS_DATA_VAR(_args)); \
\
__event_notifier->notification_send(__event_notifier, \
__stackvar.__interpreter_stack_data, \