X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-filter-specialize.c;h=39730f8cd954a0428ff419fe1d9114a70caf7a33;hb=fb31eb73d8a4a6d9784ed5c335b7fa3b9684108c;hp=7cbd8c592c4a782801ceae99b1d7ebd44921ee56;hpb=47e5f13e885764eecde371627001d26da2a2f41f;p=lttng-ust.git diff --git a/liblttng-ust/lttng-filter-specialize.c b/liblttng-ust/lttng-filter-specialize.c index 7cbd8c59..39730f8c 100644 --- a/liblttng-ust/lttng-filter-specialize.c +++ b/liblttng-ust/lttng-filter-specialize.c @@ -25,6 +25,9 @@ */ #define _LGPL_SOURCE +#include +#include + #include "lttng-filter.h" #include @@ -422,7 +425,7 @@ static int specialize_load_object(const struct lttng_event_field *field, break; case atype_dynamic: load->object_type = OBJECT_TYPE_DYNAMIC; - return -EINVAL; + break; case atype_struct: ERR("Structure type cannot be loaded."); return -EINVAL; @@ -621,6 +624,17 @@ int lttng_filter_specialize_bytecode(struct lttng_event *event, goto end; case FILTER_OP_RETURN: + if (vstack_ax(stack)->type == REG_S64) + *(filter_opcode_t *) pc = FILTER_OP_RETURN_S64; + ret = 0; + goto end; + + case FILTER_OP_RETURN_S64: + if (vstack_ax(stack)->type != REG_S64) { + ERR("Unexpected register type\n"); + ret = -EINVAL; + goto end; + } ret = 0; goto end; @@ -630,8 +644,6 @@ int lttng_filter_specialize_bytecode(struct lttng_event *event, case FILTER_OP_MOD: case FILTER_OP_PLUS: case FILTER_OP_MINUS: - case FILTER_OP_RSHIFT: - case FILTER_OP_LSHIFT: ERR("unsupported bytecode op %u\n", (unsigned int) *(filter_opcode_t *) pc); ret = -EINVAL; @@ -959,6 +971,8 @@ int lttng_filter_specialize_bytecode(struct lttng_event *event, case FILTER_OP_LT_S64_DOUBLE: case FILTER_OP_GE_S64_DOUBLE: case FILTER_OP_LE_S64_DOUBLE: + case FILTER_OP_BIT_RSHIFT: + case FILTER_OP_BIT_LSHIFT: case FILTER_OP_BIT_AND: case FILTER_OP_BIT_OR: case FILTER_OP_BIT_XOR: @@ -1046,6 +1060,13 @@ int lttng_filter_specialize_bytecode(struct lttng_event *event, break; } + case FILTER_OP_UNARY_BIT_NOT: + { + /* Pop 1, push 1 */ + next_pc += sizeof(struct unary_op); + break; + } + case FILTER_OP_UNARY_PLUS_S64: case FILTER_OP_UNARY_MINUS_S64: case FILTER_OP_UNARY_NOT_S64: