#ifndef CREATE_SYSCALL_TABLE
+#define OVERRIDE_64_connect
+SC_LTTNG_TRACE_EVENT(connect,
+ TP_PROTO(sc_exit(long ret,) int fd, struct sockaddr * uservaddr, int addrlen),
+ TP_ARGS(sc_exit(ret,) fd, uservaddr, addrlen),
+ TP_locvar(
+ __typeof__(uservaddr->sa_family) sa_family;
+ uint16_t dport;
+ uint32_t v4addr;
+ uint16_t v6addr[8];
+ int v4addr_len, v6addr_len;
+ ),
+ TP_code(
+ sc_in(
+ memset(tp_locvar, 0, sizeof(*tp_locvar));
+ if (addrlen < sizeof(struct sockaddr))
+ goto skip_code;
+ (void) get_user(tp_locvar->sa_family, &uservaddr->sa_family);
+ switch (tp_locvar->sa_family) {
+ case AF_INET:
+ if (addrlen < sizeof(struct sockaddr_in))
+ goto skip_code;
+ (void) get_user(tp_locvar->dport, &((struct sockaddr_in *) uservaddr)->sin_port);
+ (void) get_user(tp_locvar->v4addr, &((struct sockaddr_in *) uservaddr)->sin_addr.s_addr);
+ tp_locvar->v4addr_len = 4;
+ break;
+ case AF_INET6:
+ if (addrlen < sizeof(struct sockaddr_in6))
+ goto skip_code;
+ (void) get_user(tp_locvar->dport, &((struct sockaddr_in6 *) uservaddr)->sin6_port);
+ (void) copy_from_user(tp_locvar->v6addr,
+ &((struct sockaddr_in6 *) uservaddr)->sin6_addr.in6_u.u6_addr8,
+ sizeof(tp_locvar->v6addr));
+ tp_locvar->v6addr_len = 8;
+ break;
+ }
+ skip_code:
+ )
+ ),
+ TP_STRUCT__entry(
+ sc_exit(__field(long, ret))
+ sc_in(__field(int, fd))
+ sc_in(__field_hex(struct sockaddr *, uservaddr))
+ sc_in(__field_hex(int, addrlen))
+ sc_in(__field(int, family))
+ sc_in(__field_network(uint16_t, dport))
+ sc_in(__dynamic_array_network(uint8_t, v4addr, tp_locvar->v4addr_len))
+ sc_in(__dynamic_array_network_hex(uint16_t, v6addr, tp_locvar->v6addr_len))
+ ),
+ TP_fast_assign(
+ sc_exit(tp_assign(ret, ret))
+ sc_in(tp_assign(fd, fd))
+ sc_in(tp_assign(uservaddr, uservaddr))
+ sc_in(tp_assign(addrlen, addrlen))
+ sc_in(tp_assign(family, tp_locvar->sa_family))
+ sc_in(tp_assign(dport, tp_locvar->dport))
+ sc_in(tp_memcpy_dyn(v4addr, &tp_locvar->v4addr))
+ sc_in(tp_memcpy_dyn(v6addr, &tp_locvar->v6addr))
+ ),
+ TP_printk()
+)
+
+#define OVERRIDE_64_accept
+SC_LTTNG_TRACE_EVENT(accept,
+ TP_PROTO(sc_exit(long ret,) int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen),
+ TP_ARGS(sc_exit(ret,) fd, upeer_sockaddr, upeer_addrlen),
+ TP_locvar(
+ __typeof__(upeer_sockaddr->sa_family) sa_family;
+ uint16_t sport;
+ uint32_t v4addr;
+ uint16_t v6addr[8];
+ int v4addr_len, v6addr_len;
+ int uaddr_len;
+ ),
+ TP_code(
+ sc_inout(
+ memset(tp_locvar, 0, sizeof(*tp_locvar));
+ (void) get_user(tp_locvar->uaddr_len, upeer_addrlen);
+ )
+ sc_out(
+ if (tp_locvar->uaddr_len < sizeof(struct sockaddr))
+ goto skip_code;
+ (void) get_user(tp_locvar->sa_family, &upeer_sockaddr->sa_family);
+ switch (tp_locvar->sa_family) {
+ case AF_INET:
+ if (tp_locvar->uaddr_len < sizeof(struct sockaddr_in))
+ goto skip_code;
+ (void) get_user(tp_locvar->sport, &((struct sockaddr_in *) upeer_sockaddr)->sin_port);
+ (void) get_user(tp_locvar->v4addr, &((struct sockaddr_in *) upeer_sockaddr)->sin_addr.s_addr);
+ tp_locvar->v4addr_len = 4;
+ break;
+ case AF_INET6:
+ if (tp_locvar->uaddr_len < sizeof(struct sockaddr_in6))
+ goto skip_code;
+ (void) get_user(tp_locvar->sport, &((struct sockaddr_in6 *) upeer_sockaddr)->sin6_port);
+ (void) copy_from_user(tp_locvar->v6addr,
+ &((struct sockaddr_in6 *) upeer_sockaddr)->sin6_addr.in6_u.u6_addr8,
+ sizeof(tp_locvar->v6addr));
+ tp_locvar->v6addr_len = 8;
+ break;
+ }
+ skip_code:
+ )
+ ),
+ TP_STRUCT__entry(
+ sc_exit(__field(long, ret))
+ sc_in(__field(int, fd))
+ sc_in(__field_hex(struct sockaddr *, upeer_sockaddr))
+ sc_inout(__field(int, upeer_addrlen))
+ sc_out(__field(int, family))
+ sc_out(__field_network(uint16_t, sport))
+ sc_out(__dynamic_array_network(uint8_t, v4addr, tp_locvar->v4addr_len))
+ sc_out(__dynamic_array_network_hex(uint16_t, v6addr, tp_locvar->v6addr_len))
+ ),
+ TP_fast_assign(
+ sc_exit(tp_assign(ret, ret))
+ sc_in(tp_assign(fd, fd))
+ sc_in(tp_assign(upeer_sockaddr, upeer_sockaddr))
+ sc_inout(tp_assign(upeer_addrlen, tp_locvar->uaddr_len))
+ sc_out(tp_assign(family, tp_locvar->sa_family))
+ sc_out(tp_assign(sport, tp_locvar->sport))
+ sc_out(tp_memcpy_dyn(v4addr, &tp_locvar->v4addr))
+ sc_out(tp_memcpy_dyn(v6addr, &tp_locvar->v6addr))
+ ),
+ TP_printk()
+)
+
#else /* CREATE_SYSCALL_TABLE */
#define OVERRIDE_TABLE_64_clone
#include <linux/compat.h>
#include <linux/err.h>
#include <linux/bitmap.h>
+#include <linux/in.h>
+#include <linux/in6.h>
#include <asm/ptrace.h>
#include <asm/syscall.h>
#define SC_TRACE_EVENT(_name, _proto, _args, _struct, _assign, _printk) \
TRACE_EVENT(syscall_enter_##_name, PARAMS(_proto), PARAMS(_args),\
PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+ LTTNG_TRACE_EVENT(syscall_enter_##_name, PARAMS(_proto), PARAMS(_args),\
+ PARAMS(_locvar), PARAMS(_code),\
+ PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
#define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
DECLARE_EVENT_CLASS_NOARGS(syscall_enter_##_name, PARAMS(_struct), PARAMS(_assign),\
PARAMS(_printk))
#include "instrumentation/syscalls/headers/syscalls_pointers.h"
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
#undef SC_TRACE_EVENT
#undef SC_DECLARE_EVENT_CLASS_NOARGS
#undef SC_DEFINE_EVENT_NOARGS
TRACE_EVENT(compat_syscall_enter_##_name, PARAMS(_proto), PARAMS(_args), \
PARAMS(_struct), PARAMS(_assign), \
PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+ LTTNG_TRACE_EVENT(compat_syscall_enter_##_name, PARAMS(_proto), PARAMS(_args),\
+ PARAMS(_locvar), PARAMS(_code),\
+ PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
#define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
DECLARE_EVENT_CLASS_NOARGS(compat_syscall_enter_##_name, PARAMS(_struct), \
PARAMS(_assign), PARAMS(_printk))
#include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
#undef SC_TRACE_EVENT
#undef SC_DECLARE_EVENT_CLASS_NOARGS
#undef SC_DEFINE_EVENT_NOARGS
#define SC_TRACE_EVENT(_name, _proto, _args, _struct, _assign, _printk) \
TRACE_EVENT(syscall_exit_##_name, PARAMS(_proto), PARAMS(_args),\
PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+ LTTNG_TRACE_EVENT(syscall_exit_##_name, PARAMS(_proto), PARAMS(_args),\
+ PARAMS(_locvar), PARAMS(_code),\
+ PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
#define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
DECLARE_EVENT_CLASS_NOARGS(syscall_exit_##_name, PARAMS(_struct), \
PARAMS(_assign), PARAMS(_printk))
#include "instrumentation/syscalls/headers/syscalls_pointers.h"
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
#undef SC_TRACE_EVENT
#undef SC_DECLARE_EVENT_CLASS_NOARGS
#undef SC_DEFINE_EVENT_NOARGS
#define SC_TRACE_EVENT(_name, _proto, _args, _struct, _assign, _printk) \
TRACE_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+ LTTNG_TRACE_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args),\
+ PARAMS(_locvar), PARAMS(_code),\
+ PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
#define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
DECLARE_EVENT_CLASS_NOARGS(compat_syscall_exit_##_name, PARAMS(_struct), \
PARAMS(_assign), PARAMS(_printk))
#include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
#undef SC_TRACE_EVENT
#undef SC_DECLARE_EVENT_CLASS_NOARGS
#undef SC_DEFINE_EVENT_NOARGS
PARAMS(print)) \
DEFINE_EVENT_MAP_NOARGS(map, name, map)
+#undef LTTNG_TRACE_EVENT
+#define LTTNG_TRACE_EVENT(name, proto, args, _locvar, _code, tstruct, assign, print) \
+ LTTNG_DECLARE_EVENT_CLASS(name, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(_locvar), \
+ PARAMS(_code), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print)) \
+ DEFINE_EVENT_MAP(name, name, name, PARAMS(proto), PARAMS(args))
+
#undef DEFINE_EVENT_PRINT_MAP
#define DEFINE_EVENT_PRINT_MAP(template, name, map, proto, args, print) \
DEFINE_EVENT_MAP(template, name, map, PARAMS(proto), PARAMS(args))
PARAMS(assign), \
PARAMS(print))
+#undef DECLARE_EVENT_CLASS
+#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
+ LTTNG_DECLARE_EVENT_CLASS(_name, PARAMS(_proto), PARAMS(_args), , , \
+ PARAMS(_tstruct), PARAMS(_assign), PARAMS(_print))
+
+#undef DECLARE_EVENT_CLASS_NOARGS
+#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
+ LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, , , PARAMS(_tstruct), \
+ PARAMS(_assign), PARAMS(_print))
+
+
/*
* Stage 1 of the trace events.
*
#define __dynamic_array_hex(_type, _item, _length) \
__dynamic_array_enc_ext(_type, _item, _length, __BYTE_ORDER, 16, none)
+#undef __dynamic_array_network_hex
+#define __dynamic_array_network_hex(_type, _item, _length) \
+ __dynamic_array_enc_ext(_type, _item, _length, __BIG_ENDIAN, 16, none)
+
+#undef __dynamic_array_network
+#define __dynamic_array_network(_type, _item, _length) \
+ __dynamic_array_enc_ext(_type, _item, _length, __BIG_ENDIAN, 10, none)
+
#undef __dynamic_array_text_2
#define __dynamic_array_text_2(_type, _item, _length1, _length2) \
__dynamic_array_enc_ext_2(_type, _item, _length1, _length2, __BYTE_ORDER, 10, UTF8)
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args /* Only one used in this phase */
-#undef DECLARE_EVENT_CLASS_NOARGS
-#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
+#undef LTTNG_DECLARE_EVENT_CLASS_NOARGS
+#define LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print) \
static const struct lttng_event_field __event_fields___##_name[] = { \
_tstruct \
};
-#undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
- DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \
+#undef LTTNG_DECLARE_EVENT_CLASS
+#define LTTNG_DECLARE_EVENT_CLASS(_name, _proto, _args, _locvar, _code, _tstruct, _assign, _print) \
+ LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, PARAMS(_tstruct), PARAMS(_assign), \
PARAMS(_print))
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
#undef TP_PROTO
#define TP_PROTO(args...) args
-#undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
+#undef LTTNG_DECLARE_EVENT_CLASS
+#define LTTNG_DECLARE_EVENT_CLASS(_name, _proto, _args, _locvar, _code, _tstruct, _assign, _print) \
static void __event_probe__##_name(void *__data, _proto);
-#undef DECLARE_EVENT_CLASS_NOARGS
-#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
+#undef LTTNG_DECLARE_EVENT_CLASS_NOARGS
+#define LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print) \
static void __event_probe__##_name(void *__data);
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
#undef __dynamic_array_enc_ext
#define __dynamic_array_enc_ext(_type, _item, _length, _order, _base, _encoding)\
- __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \
__event_len += sizeof(u32); \
__event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__dynamic_len[__dynamic_len_idx] = (_length); \
#undef __dynamic_array_enc_ext_2
#define __dynamic_array_enc_ext_2(_type, _item, _length1, _length2, _order, _base, _encoding)\
- __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \
__event_len += sizeof(u32); \
__event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__dynamic_len[__dynamic_len_idx] = (_length1); \
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args
-#undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
-static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \
+#undef TP_locvar
+#define TP_locvar(...) __VA_ARGS__
+
+#undef LTTNG_DECLARE_EVENT_CLASS
+#define LTTNG_DECLARE_EVENT_CLASS(_name, _proto, _args, _locvar, _code, _tstruct, _assign, _print) \
+static inline size_t __event_get_size__##_name(size_t *__dynamic_len, \
+ void *__tp_locvar, _proto) \
{ \
size_t __event_len = 0; \
unsigned int __dynamic_len_idx __attribute__((unused)) = 0; \
+ struct { _locvar } *tp_locvar __attribute__((unused)) = __tp_locvar; \
\
_tstruct \
return __event_len; \
}
-#undef DECLARE_EVENT_CLASS_NOARGS
-#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
-static inline size_t __event_get_size__##_name(size_t *__dynamic_len) \
+#undef LTTNG_DECLARE_EVENT_CLASS_NOARGS
+#define LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print) \
+static inline size_t __event_get_size__##_name(size_t *__dynamic_len, \
+ void *__tp_locvar) \
{ \
size_t __event_len = 0; \
unsigned int __dynamic_len_idx __attribute__((unused)) = 0; \
+ struct { _locvar } *tp_locvar __attribute__((unused)) = __tp_locvar; \
\
_tstruct \
return __event_len; \
#undef __dynamic_array_enc_ext
#define __dynamic_array_enc_ext(_type, _item, _length, _order, _base, _encoding)\
- __event_align = max_t(size_t, __event_align, lttng_alignof(u32)); \
+ __event_align = max_t(size_t, __event_align, lttng_alignof(u32)); \
__event_align = max_t(size_t, __event_align, lttng_alignof(_type));
#undef __dynamic_array_enc_ext_2
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args
-#undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
-static inline size_t __event_get_align__##_name(_proto) \
+#undef TP_locvar
+#define TP_locvar(...) __VA_ARGS__
+
+#undef LTTNG_DECLARE_EVENT_CLASS
+#define LTTNG_DECLARE_EVENT_CLASS(_name, _proto, _args, _locvar, _code, _tstruct, _assign, _print) \
+static inline size_t __event_get_align__##_name(void *__tp_locvar, _proto) \
{ \
size_t __event_align = 1; \
+ struct { _locvar } *tp_locvar __attribute__((unused)) = __tp_locvar; \
+ \
_tstruct \
return __event_align; \
}
-#undef DECLARE_EVENT_CLASS_NOARGS
-#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
-static inline size_t __event_get_align__##_name(void) \
+#undef LTTNG_DECLARE_EVENT_CLASS_NOARGS
+#define LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print) \
+static inline size_t __event_get_align__##_name(void *__tp_locvar) \
{ \
size_t __event_align = 1; \
+ struct { _locvar } *tp_locvar __attribute__((unused)) = __tp_locvar; \
+ \
_tstruct \
return __event_align; \
}
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
-
/*
* Stage 8 of the trace events.
*
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args
-#undef DECLARE_EVENT_CLASS_NOARGS
-#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
+#undef LTTNG_DECLARE_EVENT_CLASS_NOARGS
+#define LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print) \
struct __event_typemap__##_name { \
_tstruct \
};
-#undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
- DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print)
+#undef LTTNG_DECLARE_EVENT_CLASS
+#define LTTNG_DECLARE_EVENT_CLASS(_name, _proto, _args, _locvar, _code, _tstruct, _assign, _print) \
+ LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print)
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
#undef TP_fast_assign
#define TP_fast_assign(args...) args
+#undef TP_locvar
+#define TP_locvar(...) __VA_ARGS__
+
+#undef TP_code
+#define TP_code(...) __VA_ARGS__
+
/*
* For state dump, check that "session" argument (mandatory) matches the
* session this event belongs to. Ensures that we write state dump data only
* __dynamic_array_enc_ext_2() and tp_memcpy_dyn_2(), which are the
* worse case, needing 2 entries per field.
*/
-#undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
+#undef LTTNG_DECLARE_EVENT_CLASS
+#define LTTNG_DECLARE_EVENT_CLASS(_name, _proto, _args, _locvar, _code, _tstruct, _assign, _print) \
static void __event_probe__##_name(void *__data, _proto) \
{ \
+ struct probe_local_vars { _locvar }; \
struct lttng_event *__event = __data; \
struct lttng_channel *__chan = __event->chan; \
struct lib_ring_buffer_ctx __ctx; \
size_t __dynamic_len[2 * ARRAY_SIZE(__event_fields___##_name)] __attribute__((unused)); \
struct __event_typemap__##_name __typemap __attribute__((unused)); \
int __ret; \
+ struct probe_local_vars __tp_locvar; \
+ struct probe_local_vars *tp_locvar __attribute__((unused)) = \
+ &__tp_locvar; \
\
if (!_TP_SESSION_CHECK(session, __chan->session)) \
return; \
return; \
if (unlikely(!ACCESS_ONCE(__event->enabled))) \
return; \
- __event_len = __event_get_size__##_name(__dynamic_len, _args); \
- __event_align = __event_get_align__##_name(_args); \
+ _code \
+ __event_len = __event_get_size__##_name(__dynamic_len, tp_locvar, \
+ _args); \
+ __event_align = __event_get_align__##_name(tp_locvar, _args); \
lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \
__event_align, -1); \
__ret = __chan->ops->event_reserve(&__ctx, __event->id); \
_assign \
}
-#undef DECLARE_EVENT_CLASS_NOARGS
-#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
+#undef LTTNG_DECLARE_EVENT_CLASS_NOARGS
+#define LTTNG_DECLARE_EVENT_CLASS_NOARGS(_name, _locvar, _code, _tstruct, _assign, _print) \
static void __event_probe__##_name(void *__data) \
{ \
+ struct probe_local_vars { _locvar }; \
struct lttng_event *__event = __data; \
struct lttng_channel *__chan = __event->chan; \
struct lib_ring_buffer_ctx __ctx; \
size_t __dynamic_len[2 * ARRAY_SIZE(__event_fields___##_name)] __attribute__((unused)); \
struct __event_typemap__##_name __typemap __attribute__((unused)); \
int __ret; \
+ struct probe_local_vars __tp_locvar; \
+ struct probe_local_vars *tp_locvar __attribute__((unused)) = \
+ &__tp_locvar; \
\
if (!_TP_SESSION_CHECK(session, __chan->session)) \
return; \
return; \
if (unlikely(!ACCESS_ONCE(__event->enabled))) \
return; \
- __event_len = __event_get_size__##_name(__dynamic_len); \
- __event_align = __event_get_align__##_name(); \
+ _code \
+ __event_len = __event_get_size__##_name(__dynamic_len, tp_locvar); \
+ __event_align = __event_get_align__##_name(tp_locvar); \
lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \
__event_align, -1); \
__ret = __chan->ops->event_reserve(&__ctx, __event->id); \