X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Flttng-filter.c;h=947ed843917579fcee828f6e9aba95a88504e238;hb=6f0a5631039e42ef0b9665942257867e1fab4faa;hp=b7f058a8dac27d680d82786ef9f9337a7b5b6410;hpb=0039e2d8d79c3260d29591fc10a07d57bcc535b3;p=lttng-ust.git diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index b7f058a8..947ed843 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -170,6 +170,8 @@ static const char *opnames[] = { [ FILTER_OP_LOAD_FIELD_DOUBLE ] = "LOAD_FIELD_DOUBLE", [ FILTER_OP_UNARY_BIT_NOT ] = "UNARY_BIT_NOT", + + [ FILTER_OP_RETURN_S64 ] = "RETURN_S64", }; const char *print_op(enum filter_op op) @@ -252,9 +254,23 @@ int apply_field_reloc(struct lttng_event *event, op->op = FILTER_OP_LOAD_FIELD_REF_S64; break; case atype_array: + { + const struct lttng_basic_type *elem_type = &field->type.u.array.elem_type; + + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + return -EINVAL; + op->op = FILTER_OP_LOAD_FIELD_REF_SEQUENCE; + break; + } case atype_sequence: + { + const struct lttng_basic_type *elem_type = &field->type.u.sequence.elem_type; + + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + return -EINVAL; op->op = FILTER_OP_LOAD_FIELD_REF_SEQUENCE; break; + } case atype_string: op->op = FILTER_OP_LOAD_FIELD_REF_STRING; break; @@ -327,9 +343,25 @@ int apply_context_reloc(struct lttng_event *event, op->op = FILTER_OP_GET_CONTEXT_REF_S64; break; /* Sequence and array supported as string */ - case atype_string: case atype_array: + { + const struct lttng_basic_type *elem_type = &ctx_field->event_field.type.u.array.elem_type; + + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + return -EINVAL; + op->op = FILTER_OP_GET_CONTEXT_REF_STRING; + break; + } case atype_sequence: + { + const struct lttng_basic_type *elem_type = &ctx_field->event_field.type.u.sequence.elem_type; + + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + return -EINVAL; + op->op = FILTER_OP_GET_CONTEXT_REF_STRING; + break; + } + case atype_string: op->op = FILTER_OP_GET_CONTEXT_REF_STRING; break; case atype_float: