Prefix lttng_enum_value and lttng_enum_entry with lttng_kernel_
[lttng-modules.git] / include / lttng / tracepoint-event-impl.h
index 079d7d37006e9e677f1ae5d16d33e680378993f7..bc13e56dc77087164b86b0d2d74805c97c7a2019 100644 (file)
@@ -272,7 +272,7 @@ void __event_notifier_template_proto___##_name(void);
 
 #undef LTTNG_TRACEPOINT_ENUM
 #define LTTNG_TRACEPOINT_ENUM(_name, _values)                          \
-       const struct lttng_enum_entry __enum_values__##_name[] = { \
+       const struct lttng_kernel_enum_entry __enum_values__##_name[] = { \
                _values                                                 \
        };
 
@@ -307,7 +307,7 @@ void __event_notifier_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_array_nestable,                \
+                 .type = lttng_kernel_type_array_nestable,             \
                  .u =                                          \
                        {                                       \
                          .array_nestable =                     \
@@ -330,7 +330,7 @@ void __event_notifier_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_array_nestable,                \
+                 .type = lttng_kernel_type_array_nestable,             \
                  .u =                                          \
                        {                                       \
                          .array_nestable =                     \
@@ -362,7 +362,7 @@ void __event_notifier_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_sequence_nestable,             \
+                 .type = lttng_kernel_type_sequence_nestable,          \
                  .u =                                          \
                        {                                       \
                          .sequence_nestable =                  \
@@ -393,7 +393,7 @@ void __event_notifier_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_sequence_nestable,             \
+                 .type = lttng_kernel_type_sequence_nestable,          \
                  .u =                                          \
                        {                                       \
                          .sequence_nestable =                  \
@@ -416,10 +416,10 @@ void __event_notifier_template_proto___##_name(void);
          .name = #_item,                                       \
          .type =                                               \
                {                                               \
-                 .atype = atype_string,                        \
+                 .type = lttng_kernel_type_string,                     \
                  .u =                                          \
                        {                                       \
-                         .string = { .encoding = lttng_encode_UTF8 }, \
+                         .string = { .encoding = lttng_kernel_string_encoding_UTF8 }, \
                        },                                      \
                },                                              \
          .nowrite = _nowrite,                                  \
@@ -432,7 +432,7 @@ void __event_notifier_template_proto___##_name(void);
        {                                                       \
                .name = #_item,                                 \
                .type = {                                       \
-                       .atype = atype_enum_nestable,           \
+                       .type = lttng_kernel_type_enum_nestable,                \
                        .u = {                                  \
                                .enum_nestable = {              \
                                        .desc = &__enum_##_name, \
@@ -1430,6 +1430,8 @@ static void __event_notifier_probe__##_name(void *__data, _proto)       \
        struct probe_local_vars __tp_locvar;                                  \
        struct probe_local_vars *tp_locvar __attribute__((unused)) =          \
                        &__tp_locvar;                                         \
+       struct lttng_kernel_notifier_ctx __notif_ctx;                         \
+       bool __interpreter_stack_prepared = false;                            \
                                                                              \
        if (unlikely(!READ_ONCE(__event_notifier->enabled)))                  \
                return;                                                       \
@@ -1440,6 +1442,7 @@ static void __event_notifier_probe__##_name(void *__data, _proto)       \
                                                                              \
                __event_prepare_interpreter_stack__##_name(__stackvar.__interpreter_stack_data, \
                                tp_locvar, _args);                            \
+               __interpreter_stack_prepared = true;                          \
                lttng_list_for_each_entry_rcu(bc_runtime, &__event_notifier->filter_bytecode_runtime_head, node) { \
                        if (unlikely(bc_runtime->interpreter_funcs.filter(bc_runtime, &__lttng_probe_ctx,       \
                                        __stackvar.__interpreter_stack_data) & LTTNG_INTERPRETER_RECORD_FLAG))  \
@@ -1449,14 +1452,16 @@ static void __event_notifier_probe__##_name(void *__data, _proto)             \
                        goto __post;                                          \
        }                                                                     \
                                                                              \
-       if (unlikely(!list_empty(&__event_notifier->capture_bytecode_runtime_head)))    \
+       __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,          \
                                tp_locvar, _args);                            \
                                                                              \
        __event_notifier->send_notification(__event_notifier,                 \
                        &__lttng_probe_ctx,                                   \
-                       __stackvar.__interpreter_stack_data);                 \
+                       __stackvar.__interpreter_stack_data,                  \
+                       &__notif_ctx);                                        \
                                                                              \
 __post:                                                                              \
        _code_post                                                            \
@@ -1481,6 +1486,8 @@ static void __event_notifier_probe__##_name(void *__data)               \
        struct probe_local_vars __tp_locvar;                                  \
        struct probe_local_vars *tp_locvar __attribute__((unused)) =          \
                        &__tp_locvar;                                         \
+       struct lttng_kernel_notifier_ctx __notif_ctx;                         \
+       bool __interpreter_stack_prepared = false;                            \
                                                                              \
        if (unlikely(!READ_ONCE(__event_notifier->enabled)))                  \
                return;                                                       \
@@ -1491,6 +1498,7 @@ static void __event_notifier_probe__##_name(void *__data)               \
                                                                              \
                __event_prepare_interpreter_stack__##_name(__stackvar.__interpreter_stack_data, \
                                tp_locvar);                                   \
+               __interpreter_stack_prepared = true;                          \
                lttng_list_for_each_entry_rcu(bc_runtime, &__event_notifier->filter_bytecode_runtime_head, node) { \
                        if (unlikely(bc_runtime->interpreter_funcs.filter(bc_runtime, &__lttng_probe_ctx,       \
                                        __stackvar.__interpreter_stack_data) & LTTNG_INTERPRETER_RECORD_FLAG))  \
@@ -1500,14 +1508,16 @@ static void __event_notifier_probe__##_name(void *__data)                     \
                        goto __post;                                          \
        }                                                                     \
                                                                              \
-       if (unlikely(!list_empty(&__event_notifier->capture_bytecode_runtime_head)))  \
+       __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,          \
                                tp_locvar);                                   \
                                                                              \
        __event_notifier->send_notification(__event_notifier,                 \
                        &__lttng_probe_ctx,                                   \
-                       __stackvar.__interpreter_stack_data);                 \
+                       __stackvar.__interpreter_stack_data,                  \
+                       &__notif_ctx);                                        \
 __post:                                                                              \
        _code_post                                                            \
        return;                                                               \
This page took 0.025511 seconds and 4 git commands to generate.