Fix: mm_compaction_migratepages changed in linux 6.9-rc1
[lttng-modules.git] / include / lttng / lttng-bytecode.h
index 3cbb7b10cb995bd2503ed1e169448c9ede4853fb..f104b0ebfdf0ff4043eb82496d4cf216f5052565 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 
 #include <lttng/events.h>
+#include <lttng/events-internal.h>
 #include <lttng/bytecode.h>
 
 /* Interpreter stack length, in number of entries */
@@ -34,14 +35,14 @@ do {                                                                \
 } while (0)
 #endif
 
-/* Linked bytecode. Child of struct lttng_bytecode_runtime. */
+/* Linked bytecode. Child of struct lttng_kernel_bytecode_runtime. */
 struct bytecode_runtime {
-       struct lttng_bytecode_runtime p;
+       struct lttng_kernel_bytecode_runtime p;
        size_t data_len;
        size_t data_alloc_len;
        char *data;
        uint16_t len;
-       char code[0];
+       char code[];
 };
 
 enum entry_type {
@@ -71,6 +72,9 @@ enum object_type {
        OBJECT_TYPE_U32,
        OBJECT_TYPE_U64,
 
+       OBJECT_TYPE_SIGNED_ENUM,
+       OBJECT_TYPE_UNSIGNED_ENUM,
+
        OBJECT_TYPE_DOUBLE,
        OBJECT_TYPE_STRING,
        OBJECT_TYPE_STRING_SEQUENCE,
@@ -93,11 +97,12 @@ struct bytecode_get_index_data {
         * interpreter needs to find it from the event fields and types to
         * support variants.
         */
-       const struct lttng_event_field *field;
+       const struct lttng_kernel_event_field *field;
        struct {
                size_t len;
                enum object_type type;
                bool rev_bo;    /* reverse byte order */
+               bool user;      /* from userspace */
        } elem;
 };
 
@@ -105,8 +110,9 @@ struct bytecode_get_index_data {
 struct vstack_load {
        enum load_type type;
        enum object_type object_type;
-       const struct lttng_event_field *field;
+       const struct lttng_kernel_event_field *field;
        bool rev_bo;    /* reverse byte order */
+       bool user;      /* from userspace */
 };
 
 struct vstack_entry {
@@ -176,13 +182,14 @@ struct load_ptr {
        const void *ptr;
        size_t nr_elem;
        bool rev_bo;
+       bool user;      /* from userspace */
        /* Temporary place-holders for contexts. */
        union {
                int64_t s64;
                uint64_t u64;
                double d;
        } u;
-       const struct lttng_event_field *field;
+       const struct lttng_kernel_event_field *field;
 };
 
 struct estack_entry {
@@ -195,7 +202,7 @@ struct estack_entry {
                        const char __user *user_str;
                        size_t seq_len;
                        enum estack_string_literal_type literal_type;
-                       int user;               /* is string from userspace ? */
+                       bool user;              /* is string from userspace ? */
                } s;
                struct load_ptr ptr;
        } u;
@@ -267,29 +274,36 @@ struct lttng_interpreter_output {
 
                struct {
                        const char *str;
+                       const char __user *user_str;
                        size_t len;
+                       bool user;              /* is string from userspace ? */
                } str;
                struct {
                        const void *ptr;
                        size_t nr_elem;
 
                        /* Inner type. */
-                       const struct lttng_type *nested_type;
+                       const struct lttng_kernel_type_common *nested_type;
                } sequence;
        } u;
 };
 
 const char *lttng_bytecode_print_op(enum bytecode_op op);
 
+void lttng_bytecode_sync_state(struct lttng_kernel_bytecode_runtime *runtime);
 int lttng_bytecode_validate(struct bytecode_runtime *bytecode);
-int lttng_bytecode_specialize(const struct lttng_event_desc *event_desc,
+int lttng_bytecode_validate_load(struct bytecode_runtime *bytecode);
+int lttng_bytecode_specialize(const struct lttng_kernel_event_desc *event_desc,
                struct bytecode_runtime *bytecode);
 
-uint64_t lttng_bytecode_filter_interpret_false(void *filter_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
-               const char *filter_stack_data);
-uint64_t lttng_bytecode_filter_interpret(void *filter_data,
-               struct lttng_probe_ctx *lttng_probe_ctx,
-               const char *filter_stack_data);
+int lttng_bytecode_interpret_error(struct lttng_kernel_bytecode_runtime *bytecode_runtime,
+               const char *stack_data,
+               struct lttng_kernel_probe_ctx *probe_ctx,
+               void *ctx);
+
+int lttng_bytecode_interpret(struct lttng_kernel_bytecode_runtime *kernel_bytecode,
+               const char *interpreter_stack_data,
+               struct lttng_kernel_probe_ctx *lttng_probe_ctx,
+               void *caller_ctx);
 
 #endif /* _LTTNG_FILTER_H */
This page took 0.026595 seconds and 4 git commands to generate.