+#undef _LTTNG_TRACEPOINT_EVENT_CLASS_CODE
+#define _LTTNG_TRACEPOINT_EVENT_CLASS_CODE(_name, _data_proto, _locvar_args, _locvar, _code_pre, _fields, _code_post) \
+static void __event_probe__##_name(_data_proto) \
+{ \
+ struct probe_local_vars { _locvar }; \
+ struct lttng_kernel_event_common *__event = __data; \
+ struct lttng_kernel_probe_ctx __lttng_probe_ctx = { \
+ .event = __event, \
+ .interruptible = !irqs_disabled(), \
+ }; \
+ union { \
+ size_t __dynamic_len_removed[ARRAY_SIZE(__event_fields___##_name)]; \
+ char __interpreter_stack_data[2 * sizeof(unsigned long) * ARRAY_SIZE(__event_fields___##_name)]; \
+ } __stackvar; \
+ size_t __orig_dynamic_len_offset, __dynamic_len_idx __attribute__((unused)); \
+ struct probe_local_vars __tp_locvar; \
+ struct probe_local_vars *tp_locvar __attribute__((unused)) = \
+ &__tp_locvar; \
+ bool __interpreter_stack_prepared = false; \
+ \
+ switch (__event->type) { \
+ case LTTNG_KERNEL_EVENT_TYPE_RECORDER: \
+ { \
+ struct lttng_kernel_event_recorder *__event_recorder = \
+ container_of(__event, struct lttng_kernel_event_recorder, parent); \
+ struct lttng_channel *__chan = __event_recorder->chan; \
+ struct lttng_kernel_session *__session = __chan->session; \
+ struct lttng_kernel_id_tracker_rcu *__lf; \
+ \
+ if (!_TP_SESSION_CHECK(session, __session)) \
+ return; \
+ if (unlikely(!LTTNG_READ_ONCE(__session->active))) \
+ return; \
+ if (unlikely(!LTTNG_READ_ONCE(__chan->enabled))) \
+ return; \
+ __lf = lttng_rcu_dereference(__session->pid_tracker.p); \
+ if (__lf && likely(!lttng_id_tracker_lookup(__lf, current->tgid))) \
+ return; \
+ __lf = lttng_rcu_dereference(__session->vpid_tracker.p); \
+ if (__lf && likely(!lttng_id_tracker_lookup(__lf, task_tgid_vnr(current)))) \
+ return; \
+ __lf = lttng_rcu_dereference(__session->uid_tracker.p); \
+ if (__lf && likely(!lttng_id_tracker_lookup(__lf, \
+ lttng_current_uid()))) \
+ return; \
+ __lf = lttng_rcu_dereference(__session->vuid_tracker.p); \
+ if (__lf && likely(!lttng_id_tracker_lookup(__lf, \
+ lttng_current_vuid()))) \
+ return; \
+ __lf = lttng_rcu_dereference(__session->gid_tracker.p); \
+ if (__lf && likely(!lttng_id_tracker_lookup(__lf, \
+ lttng_current_gid()))) \
+ return; \
+ __lf = lttng_rcu_dereference(__session->vgid_tracker.p); \
+ if (__lf && likely(!lttng_id_tracker_lookup(__lf, \
+ lttng_current_vgid()))) \
+ return; \
+ break; \
+ } \
+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: \
+ break; \
+ default: \
+ WARN_ON_ONCE(1); \
+ } \
+ if (unlikely(!READ_ONCE(__event->enabled))) \
+ return; \
+ __orig_dynamic_len_offset = this_cpu_ptr(<tng_dynamic_len_stack)->offset; \
+ __dynamic_len_idx = __orig_dynamic_len_offset; \
+ _code_pre \
+ if (unlikely(READ_ONCE(__event->eval_filter))) { \
+ __event_prepare_interpreter_stack__##_name(__stackvar.__interpreter_stack_data, \
+ _locvar_args); \
+ __interpreter_stack_prepared = true; \
+ if (likely(__event->run_filter(__event, \
+ __stackvar.__interpreter_stack_data, &__lttng_probe_ctx, NULL) != LTTNG_KERNEL_EVENT_FILTER_ACCEPT)) \
+ goto __post; \
+ } \
+ switch (__event->type) { \
+ case LTTNG_KERNEL_EVENT_TYPE_RECORDER: \
+ { \
+ struct lttng_kernel_event_recorder *__event_recorder = \
+ container_of(__event, struct lttng_kernel_event_recorder, parent); \
+ struct lttng_channel *__chan = __event_recorder->chan; \
+ struct lttng_kernel_ring_buffer_ctx __ctx; \
+ ssize_t __event_len; \
+ size_t __event_align; \
+ int __ret; \
+ \
+ __event_len = __event_get_size__##_name(_locvar_args); \
+ if (unlikely(__event_len < 0)) { \
+ lib_ring_buffer_lost_event_too_big(__chan->chan); \
+ goto __post; \
+ } \
+ __event_align = __event_get_align__##_name(_locvar_args); \
+ lib_ring_buffer_ctx_init(&__ctx, __event_recorder, __event_len, \
+ __event_align, &__lttng_probe_ctx); \
+ __ret = __chan->ops->event_reserve(&__ctx); \
+ if (__ret < 0) \
+ goto __post; \
+ _fields \
+ __chan->ops->event_commit(&__ctx); \
+ break; \
+ } \
+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: \
+ { \
+ struct lttng_kernel_event_notifier *__event_notifier = \
+ container_of(__event, struct lttng_kernel_event_notifier, parent); \
+ struct lttng_kernel_notification_ctx __notif_ctx; \
+ \
+ __notif_ctx.eval_capture = LTTNG_READ_ONCE(__event_notifier->eval_capture); \
+ if (unlikely(!__interpreter_stack_prepared && __notif_ctx.eval_capture)) \
+ __event_prepare_interpreter_stack__##_name( \
+ __stackvar.__interpreter_stack_data, \
+ _locvar_args); \
+ \
+ __event_notifier->notification_send(__event_notifier, \
+ __stackvar.__interpreter_stack_data, \
+ &__lttng_probe_ctx, \
+ &__notif_ctx); \
+ break; \
+ } \
+ default: \
+ WARN_ON_ONCE(1); \
+ } \
+__post: \
+ _code_post \
+ barrier(); /* use before un-reserve. */ \
+ this_cpu_ptr(<tng_dynamic_len_stack)->offset = __orig_dynamic_len_offset; \
+ return; \
+}
+