Refactoring: bytecode interpreter ABI
[lttng-ust.git] / include / lttng / ust-tracepoint-event.h
index 50cbfbbcf831dea3a3b830d791de86cb982ccbac..4fc1ea91aa8c6f49abe3e5871221d4db5110f0af 100644 (file)
@@ -194,7 +194,7 @@ void __event_template_proto___##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)
                        .signedness = 0,                                \
                },                                                      \
                .string = (_string),                                    \
-               .options = LTTNG_ENUM_ENTRY_OPTION_IS_AUTO,             \
+               .options = LTTNG_UST_ENUM_ENTRY_OPTION_IS_AUTO,         \
        }),
 
 #undef TP_ENUM_VALUES
@@ -803,13 +803,14 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))         \
        case LTTNG_UST_EVENT_TYPE_RECORDER:                                   \
        {                                                                     \
                struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \
-               struct lttng_channel *__chan = __event_recorder->chan;        \
+               struct lttng_ust_channel_buffer *__chan = __event_recorder->chan; \
+               struct lttng_ust_channel_common *__chan_common = __chan->parent; \
                                                                              \
-               if (!_TP_SESSION_CHECK(session, __chan->session))             \
+               if (!_TP_SESSION_CHECK(session, __chan_common->session))      \
                        return;                                               \
-               if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active)))  \
+               if (caa_unlikely(!CMM_ACCESS_ONCE(__chan_common->session->active))) \
                        return;                                               \
-               if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled)))          \
+               if (caa_unlikely(!CMM_ACCESS_ONCE(__chan_common->enabled)))   \
                        return;                                               \
                break;                                                        \
        }                                                                     \
@@ -823,14 +824,18 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))         \
        if (caa_unlikely(!cds_list_empty(&__event->filter_bytecode_runtime_head))) { \
                struct lttng_ust_bytecode_runtime *__filter_bc_runtime;       \
                int __filter_record = __event->has_enablers_without_bytecode; \
+               struct lttng_ust_bytecode_filter_ctx filter_ctx;              \
                                                                              \
+               filter_ctx.struct_size = sizeof(struct lttng_ust_bytecode_filter_ctx); \
                __event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
                        _TP_ARGS_DATA_VAR(_args));                            \
                tp_list_for_each_entry_rcu(__filter_bc_runtime, &__event->filter_bytecode_runtime_head, node) { \
-                       if (caa_unlikely(__filter_bc_runtime->interpreter_funcs.filter(__filter_bc_runtime,     \
-                                       __stackvar.__interpreter_stack_data) & LTTNG_INTERPRETER_RECORD_FLAG)) { \
-                               __filter_record = 1;                          \
-                               break;                                        \
+                       if (caa_likely(__filter_bc_runtime->interpreter_func(__filter_bc_runtime, \
+                               __stackvar.__interpreter_stack_data, &filter_ctx) == LTTNG_UST_BYTECODE_INTERPRETER_OK)) { \
+                               if (caa_unlikely(filter_ctx.result == LTTNG_UST_BYTECODE_FILTER_ACCEPT)) { \
+                                       __filter_record = 1;                  \
+                                       break;                                \
+                               }                                             \
                        }                                                     \
                }                                                             \
                if (caa_likely(!__filter_record))                             \
@@ -841,7 +846,7 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))           \
        {                                                                     \
                size_t __event_len, __event_align;                            \
                struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \
-               struct lttng_channel *__chan = __event_recorder->chan;        \
+               struct lttng_ust_channel_buffer *__chan = __event_recorder->chan; \
                struct lttng_ust_lib_ring_buffer_ctx __ctx;                   \
                struct lttng_ust_stack_ctx __lttng_ctx;                       \
                                                                              \
@@ -851,8 +856,6 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))           \
                memset(&__lttng_ctx, 0, sizeof(__lttng_ctx));                 \
                __lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx);     \
                __lttng_ctx.event_recorder = __event_recorder;                \
-               __lttng_ctx.chan_ctx = tp_rcu_dereference(__chan->ctx);       \
-               __lttng_ctx.event_ctx = tp_rcu_dereference(__event_recorder->ctx); \
                lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_ctx, __event_len, \
                                         __event_align, -1, __chan->handle); \
                __ctx.ip = _TP_IP_PARAM(TP_IP_PARAM);                         \
This page took 0.025929 seconds and 4 git commands to generate.