X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Flttng-bytecode-interpreter.c;h=bba3cac8dcb8991f35238207eb3ba16701eb840e;hb=185c782861fe6ed224d14293afc57c46ab5e7aed;hp=9a2aaa45ec97b63748150c7700dadaac6f49ddc6;hpb=70f9f7f95a5a36231e4a71191bcd88d582c3ca81;p=lttng-ust.git diff --git a/liblttng-ust/lttng-bytecode-interpreter.c b/liblttng-ust/lttng-bytecode-interpreter.c index 9a2aaa45..bba3cac8 100644 --- a/liblttng-ust/lttng-bytecode-interpreter.c +++ b/liblttng-ust/lttng-bytecode-interpreter.c @@ -172,6 +172,13 @@ uint64_t lttng_bytecode_filter_interpret_false(void *filter_data, return LTTNG_INTERPRETER_DISCARD; } +uint64_t lttng_bytecode_capture_interpret_false(void *capture_data, + const char *capture_stack_data, + struct lttng_interpreter_output *output) +{ + return LTTNG_INTERPRETER_DISCARD; +} + #ifdef INTERPRETER_USE_SWITCH /* @@ -345,12 +352,25 @@ static int context_get_index(struct lttng_ctx *ctx, switch (v.sel) { case LTTNG_UST_DYNAMIC_TYPE_NONE: return -EINVAL; + case LTTNG_UST_DYNAMIC_TYPE_U8: + case LTTNG_UST_DYNAMIC_TYPE_U16: + case LTTNG_UST_DYNAMIC_TYPE_U32: + case LTTNG_UST_DYNAMIC_TYPE_U64: + ptr->object_type = OBJECT_TYPE_U64; + ptr->u.u64 = v.u.u64; + ptr->ptr = &ptr->u.u64; + dbg_printf("context get index dynamic u64 %" PRIi64 "\n", ptr->u.u64); + break; + case LTTNG_UST_DYNAMIC_TYPE_S8: + case LTTNG_UST_DYNAMIC_TYPE_S16: + case LTTNG_UST_DYNAMIC_TYPE_S32: case LTTNG_UST_DYNAMIC_TYPE_S64: ptr->object_type = OBJECT_TYPE_S64; ptr->u.s64 = v.u.s64; ptr->ptr = &ptr->u.s64; dbg_printf("context get index dynamic s64 %" PRIi64 "\n", ptr->u.s64); break; + case LTTNG_UST_DYNAMIC_TYPE_FLOAT: case LTTNG_UST_DYNAMIC_TYPE_DOUBLE: ptr->object_type = OBJECT_TYPE_DOUBLE; ptr->u.d = v.u.d; @@ -738,9 +758,12 @@ again: } /* - * Return 0 (discard), or raise the 0x1 flag (log event). - * Currently, other flags are kept for future extensions and have no - * effect. + * For `output` equal to NULL: + * Return 0 (discard), or raise the 0x1 flag (log event). + * Currently, other flags are kept for future extensions and have no + * effect. + * For `output` not equal to NULL: + * Return 0 on success, negative error value on error. */ static uint64_t bytecode_interpret(void *interpreter_data, @@ -2531,6 +2554,14 @@ uint64_t lttng_bytecode_filter_interpret(void *filter_data, return bytecode_interpret(filter_data, filter_stack_data, NULL); } +uint64_t lttng_bytecode_capture_interpret(void *capture_data, + const char *capture_stack_data, + struct lttng_interpreter_output *output) +{ + return bytecode_interpret(capture_data, capture_stack_data, + (struct lttng_interpreter_output *) output); +} + #undef START_OP #undef OP #undef PO