+
+void lttng_event_notifier_notification_send(struct lttng_kernel_event_notifier *event_notifier,
+ const char *stack_data,
+ struct lttng_kernel_probe_ctx *probe_ctx,
+ struct lttng_kernel_notification_ctx *notif_ctx)
+{
+ struct lttng_event_notifier_notification notif = { 0 };
+ int ret;
+
+ if (unlikely(!READ_ONCE(event_notifier->parent.enabled)))
+ return;
+
+ ret = notification_init(¬if, event_notifier);
+ if (ret) {
+ WARN_ON_ONCE(1);
+ goto end;
+ }
+
+ if (unlikely(notif_ctx->eval_capture)) {
+ struct lttng_kernel_bytecode_runtime *capture_bc_runtime;
+
+ /*
+ * Iterate over all the capture bytecodes. If the interpreter
+ * functions returns successfully, append the value of the
+ * `output` parameter to the capture buffer. If the interpreter
+ * fails, append an empty capture to the buffer.
+ */
+ list_for_each_entry_rcu(capture_bc_runtime,
+ &event_notifier->priv->capture_bytecode_runtime_head, node) {
+ struct lttng_interpreter_output output;
+
+ if (capture_bc_runtime->interpreter_func(capture_bc_runtime,
+ stack_data, probe_ctx, &output) == LTTNG_KERNEL_BYTECODE_INTERPRETER_OK)
+ ret = notification_append_capture(¬if, &output);
+ else
+ ret = notification_append_empty_capture(¬if);
+
+ if (ret)
+ printk(KERN_WARNING "Error appending capture to notification");
+ }
+ }
+
+ /*
+ * Send the notification (including the capture buffer) to the
+ * sessiond.
+ */
+ notification_send(¬if, event_notifier);
+end:
+ return;
+}