X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-bytecode-interpreter.c;h=e183e330041a7d1e9883567477d41401c52b9566;hb=99d223adfae9b68800e91bda470c92acb14efae6;hp=950c0ba028fcc6ac619f27023ec9fb7dcf549d8f;hpb=80c2a69a8298768c9010052e6c3668914191b9e7;p=lttng-modules.git diff --git a/src/lttng-bytecode-interpreter.c b/src/lttng-bytecode-interpreter.c index 950c0ba0..e183e330 100644 --- a/src/lttng-bytecode-interpreter.c +++ b/src/lttng-bytecode-interpreter.c @@ -214,6 +214,14 @@ uint64_t lttng_bytecode_filter_interpret_false(void *filter_data, return LTTNG_INTERPRETER_DISCARD; } +uint64_t lttng_bytecode_capture_interpret_false(void *filter_data, + struct lttng_probe_ctx *lttng_probe_ctx, + const char *capture_stack_data, + struct lttng_interpreter_output *output) +{ + return LTTNG_INTERPRETER_DISCARD; +} + #ifdef INTERPRETER_USE_SWITCH /* @@ -298,11 +306,11 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx, ctx_field->get_value(ctx_field, lttng_probe_ctx, &v); if (itype->signedness) { - ptr->object_type = OBJECT_TYPE_S64; + ptr->object_type = OBJECT_TYPE_SIGNED_ENUM; ptr->u.s64 = v.s64; ptr->ptr = &ptr->u.s64; } else { - ptr->object_type = OBJECT_TYPE_U64; + ptr->object_type = OBJECT_TYPE_UNSIGNED_ENUM; ptr->u.u64 = v.s64; /* Cast. */ ptr->ptr = &ptr->u.u64; } @@ -496,6 +504,18 @@ static int dynamic_load_field(struct estack_entry *stack_top) stack_top->type = REG_S64; break; } + case OBJECT_TYPE_SIGNED_ENUM: + { + int64_t tmp; + + dbg_printk("op load field signed enumeration\n"); + tmp = *(int64_t *) stack_top->u.ptr.ptr; + if (stack_top->u.ptr.rev_bo) + __swab64s(&tmp); + stack_top->u.v = tmp; + stack_top->type = REG_S64; + break; + } case OBJECT_TYPE_U8: dbg_printk("op load field u8\n"); stack_top->u.v = *(uint8_t *) stack_top->u.ptr.ptr; @@ -537,6 +557,18 @@ static int dynamic_load_field(struct estack_entry *stack_top) stack_top->type = REG_U64; break; } + case OBJECT_TYPE_UNSIGNED_ENUM: + { + uint64_t tmp; + + dbg_printk("op load field unsigned enumeration\n"); + tmp = *(uint64_t *) stack_top->u.ptr.ptr; + if (stack_top->u.ptr.rev_bo) + __swab64s(&tmp); + stack_top->u.v = tmp; + stack_top->type = REG_U64; + break; + } case OBJECT_TYPE_STRING: { const char *str; @@ -649,6 +681,20 @@ again: output->u.sequence.nr_elem = ax->u.ptr.field->type.u.array_nestable.length; output->u.sequence.nested_type = ax->u.ptr.field->type.u.array_nestable.elem_type; break; + case OBJECT_TYPE_SIGNED_ENUM: + ret = dynamic_load_field(ax); + if (ret) + return ret; + output->type = LTTNG_INTERPRETER_TYPE_SIGNED_ENUM; + output->u.s = ax->u.v; + break; + case OBJECT_TYPE_UNSIGNED_ENUM: + ret = dynamic_load_field(ax); + if (ret) + return ret; + output->type = LTTNG_INTERPRETER_TYPE_UNSIGNED_ENUM; + output->u.u = ax->u.v; + break; case OBJECT_TYPE_STRUCT: case OBJECT_TYPE_VARIANT: default: @@ -1744,6 +1790,15 @@ uint64_t lttng_bytecode_filter_interpret(void *filter_data, filter_stack_data, NULL); } +uint64_t lttng_bytecode_capture_interpret(void *capture_data, + struct lttng_probe_ctx *lttng_probe_ctx, + const char *capture_stack_data, + struct lttng_interpreter_output *output) +{ + return bytecode_interpret(capture_data, lttng_probe_ctx, + capture_stack_data, output); +} + #undef START_OP #undef OP #undef PO