Introduce common event structure
[lttng-ust.git] / liblttng-ust / lttng-bytecode.c
index c52c79bb6ee35a3893e33e5b4607baae217b7312..5956f7bab45fe3a942f1219e229dc5a5f6585610 100644 (file)
@@ -203,13 +203,10 @@ int apply_field_reloc(const struct lttng_event_desc *event_desc,
                /* compute field offset */
                switch (fields[i].type.atype) {
                case atype_integer:
-               case atype_enum:
                case atype_enum_nestable:
                        field_offset += sizeof(int64_t);
                        break;
-               case atype_array:
                case atype_array_nestable:
-               case atype_sequence:
                case atype_sequence_nestable:
                        field_offset += sizeof(unsigned long);
                        field_offset += sizeof(void *);
@@ -242,13 +239,10 @@ int apply_field_reloc(const struct lttng_event_desc *event_desc,
                field_ref = (struct field_ref *) op->data;
                switch (field->type.atype) {
                case atype_integer:
-               case atype_enum:
                case atype_enum_nestable:
                        op->op = BYTECODE_OP_LOAD_FIELD_REF_S64;
                        break;
-               case atype_array:
                case atype_array_nestable:
-               case atype_sequence:
                case atype_sequence_nestable:
                        op->op = BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE;
                        break;
@@ -318,15 +312,12 @@ int apply_context_reloc(struct bytecode_runtime *runtime,
                field_ref = (struct field_ref *) op->data;
                switch (ctx_field->event_field.type.atype) {
                case atype_integer:
-               case atype_enum:
                case atype_enum_nestable:
                        op->op = BYTECODE_OP_GET_CONTEXT_REF_S64;
                        break;
                        /* Sequence and array supported as string */
                case atype_string:
-               case atype_array:
                case atype_array_nestable:
-               case atype_sequence:
                case atype_sequence_nestable:
                        op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING;
                        break;
@@ -407,6 +398,7 @@ static
 int link_bytecode(const struct lttng_event_desc *event_desc,
                struct lttng_ctx **ctx,
                struct lttng_ust_bytecode_node *bytecode,
+               struct cds_list_head *bytecode_runtime_head,
                struct cds_list_head *insert_loc)
 {
        int ret, offset, next_offset;
@@ -417,7 +409,7 @@ int link_bytecode(const struct lttng_event_desc *event_desc,
        if (!bytecode)
                return 0;
        /* Bytecode already linked */
-       if (bytecode_is_linked(bytecode, insert_loc))
+       if (bytecode_is_linked(bytecode, bytecode_runtime_head))
                return 0;
 
        dbg_printf("Linking...\n");
@@ -586,7 +578,7 @@ void lttng_enabler_link_bytecode(const struct lttng_event_desc *event_desc,
                insert_loc = instance_bytecode_head;
        add_within:
                dbg_printf("linking bytecode\n");
-               ret = link_bytecode(event_desc, ctx, enabler_bc, insert_loc);
+               ret = link_bytecode(event_desc, ctx, enabler_bc, instance_bytecode_head, insert_loc);
                if (ret) {
                        dbg_printf("[lttng filter] warning: cannot link event bytecode\n");
                }
@@ -618,7 +610,7 @@ void free_filter_runtime(struct cds_list_head *bytecode_runtime_head)
 
 void lttng_free_event_filter_runtime(struct lttng_event *event)
 {
-       free_filter_runtime(&event->filter_bytecode_runtime_head);
+       free_filter_runtime(&event->parent->filter_bytecode_runtime_head);
 }
 
 void lttng_free_event_notifier_filter_runtime(
This page took 0.023761 seconds and 4 git commands to generate.