X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-filter-interpreter.c;h=7efa883f2da674ae391fd8bc0ce2adf1993376f2;hb=0245c698528954caad460f2e6728e4a593d8951e;hp=1354d9c1062e5bebf1d764cf31e9116f32124116;hpb=3703f1d2e6e5a48c5fe066a7df0d1cc7f76ea4f0;p=lttng-ust.git diff --git a/liblttng-ust/lttng-filter-interpreter.c b/liblttng-ust/lttng-filter-interpreter.c index 1354d9c1..7efa883f 100644 --- a/liblttng-ust/lttng-filter-interpreter.c +++ b/liblttng-ust/lttng-filter-interpreter.c @@ -25,8 +25,9 @@ */ #define _LGPL_SOURCE -#include +#include #include +#include #include #include "lttng-filter.h" #include "string-utils.h" @@ -297,6 +298,7 @@ static int context_get_index(struct lttng_ctx *ctx, break; case atype_float: ptr->object_type = OBJECT_TYPE_DOUBLE; + ctx_field->get_value(ctx_field, &v); ptr->u.d = v.u.d; ptr->ptr = &ptr->u.d; break; @@ -742,6 +744,8 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, [ FILTER_OP_LOAD_FIELD_DOUBLE ] = &&LABEL_FILTER_OP_LOAD_FIELD_DOUBLE, [ FILTER_OP_UNARY_BIT_NOT ] = &&LABEL_FILTER_OP_UNARY_BIT_NOT, + + [ FILTER_OP_RETURN_S64 ] = &&LABEL_FILTER_OP_RETURN_S64, }; #endif /* #ifndef INTERPRETER_USE_SWITCH */ @@ -774,6 +778,12 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = 0; goto end; + OP(FILTER_OP_RETURN_S64): + /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */ + retval = !!estack_ax_v; + ret = 0; + goto end; + /* binary */ OP(FILTER_OP_MUL): OP(FILTER_OP_DIV): @@ -1562,7 +1572,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - res = (estack_bx_v >> estack_ax_v); + res = ((uint64_t) estack_bx_v >> (uint32_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1583,7 +1593,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, ret = -EINVAL; goto end; } - res = (estack_bx_v << estack_ax_v); + res = ((uint64_t) estack_bx_v << (uint32_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1600,7 +1610,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - res = (estack_bx_v & estack_ax_v); + res = ((uint64_t) estack_bx_v & (uint64_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1617,7 +1627,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - res = (estack_bx_v | estack_ax_v); + res = ((uint64_t) estack_bx_v | (uint64_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1634,7 +1644,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - res = (estack_bx_v ^ estack_ax_v); + res = ((uint64_t) estack_bx_v ^ (uint64_t) estack_ax_v); estack_pop(stack, top, ax, bx, ax_t, bx_t); estack_ax_v = res; estack_ax_t = REG_S64; @@ -1711,7 +1721,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; } - estack_ax_v = ~estack_ax_v; + estack_ax_v = ~(uint64_t) estack_ax_v; next_pc += sizeof(struct unary_op); PO; }