#endif
-#define IS_INTEGER_REGISTER(reg_type) (reg_type == REG_S64)
+#define IS_INTEGER_REGISTER(reg_type) \
+ (reg_type == REG_S64 || reg_type == REG_U64)
static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx,
struct load_ptr *ptr,
case OBJECT_TYPE_U8:
dbg_printk("op load field u8\n");
stack_top->u.v = *(uint8_t *) stack_top->u.ptr.ptr;
- stack_top->type = REG_S64;
+ stack_top->type = REG_U64;
break;
case OBJECT_TYPE_U16:
{
if (stack_top->u.ptr.rev_bo)
__swab16s(&tmp);
stack_top->u.v = tmp;
- stack_top->type = REG_S64;
+ stack_top->type = REG_U64;
break;
}
case OBJECT_TYPE_U32:
if (stack_top->u.ptr.rev_bo)
__swab32s(&tmp);
stack_top->u.v = tmp;
- stack_top->type = REG_S64;
+ stack_top->type = REG_U64;
break;
}
case OBJECT_TYPE_U64:
if (stack_top->u.ptr.rev_bo)
__swab64s(&tmp);
stack_top->u.v = tmp;
- stack_top->type = REG_S64;
+ stack_top->type = REG_U64;
break;
}
case OBJECT_TYPE_STRING:
/* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */
switch (estack_ax_t) {
case REG_S64:
+ case REG_U64:
retval = !!estack_ax_v;
break;
case REG_DOUBLE:
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;
+ estack_ax_t = REG_U64;
next_pc += sizeof(struct binary_op);
PO;
}
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;
+ estack_ax_t = REG_U64;
next_pc += sizeof(struct binary_op);
PO;
}
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;
+ estack_ax_t = REG_U64;
next_pc += sizeof(struct binary_op);
PO;
}
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;
+ estack_ax_t = REG_U64;
next_pc += sizeof(struct binary_op);
PO;
}
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;
+ estack_ax_t = REG_U64;
next_pc += sizeof(struct binary_op);
PO;
}
}
break;
case REG_S64:
+ case REG_U64:
goto error_mismatch;
}
break;
break;
case REG_STAR_GLOB_STRING:
case REG_S64:
+ case REG_U64:
goto error_mismatch;
}
break;
case REG_S64:
+ case REG_U64:
switch (vstack_bx(stack)->type) {
default:
case REG_DOUBLE:
case REG_STAR_GLOB_STRING:
goto error_mismatch;
case REG_S64:
+ case REG_U64:
break;
}
break;
case REG_STRING:
case REG_STAR_GLOB_STRING:
case REG_S64:
+ case REG_U64:
goto unknown;
}
break;
goto error_type;
case REG_TYPE_UNKNOWN:
case REG_S64:
+ case REG_U64:
goto unknown;
}
break;
case REG_S64:
+ case REG_U64:
switch (vstack_bx(stack)->type) {
default:
case REG_DOUBLE:
case REG_TYPE_UNKNOWN:
goto unknown;
case REG_S64:
+ case REG_U64:
break;
}
break;
ret = -EINVAL;
goto end;
}
- if (vstack_ax(stack)->type != REG_S64
- || vstack_bx(stack)->type != REG_S64) {
+ switch (vstack_ax(stack)->type) {
+ case REG_S64:
+ case REG_U64:
+ break;
+ default:
+ printk(KERN_WARNING "LTTng: filter: Unexpected register type for s64 comparator\n");
+ ret = -EINVAL;
+ goto end;
+ }
+ switch (vstack_bx(stack)->type) {
+ case REG_S64:
+ case REG_U64:
+ break;
+ default:
printk(KERN_WARNING "LTTng: filter: Unexpected register type for s64 comparator\n");
ret = -EINVAL;
goto end;
ret = -EINVAL;
goto end;
case REG_S64:
+ case REG_U64:
case REG_TYPE_UNKNOWN:
break;
}
ret = -EINVAL;
goto end;
case REG_S64:
- break;
+ case REG_U64:
case REG_TYPE_UNKNOWN:
break;
}
ret = -EINVAL;
goto end;
}
- if (vstack_ax(stack)->type != REG_S64) {
+ if (vstack_ax(stack)->type != REG_S64 &&
+ vstack_ax(stack)->type != REG_U64) {
printk(KERN_WARNING "LTTng: filter: Invalid register type\n");
ret = -EINVAL;
goto end;
ret = -EINVAL;
goto end;
}
- if (vstack_ax(stack)->type != REG_S64) {
+ if (vstack_ax(stack)->type != REG_S64 &&
+ vstack_ax(stack)->type != REG_U64) {
printk(KERN_WARNING "LTTng: filter: Logical comparator expects S64 register\n");
ret = -EINVAL;
goto end;
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
case REG_TYPE_UNKNOWN:
break;
default:
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
break;
default:
case REG_TYPE_UNKNOWN:
case FILTER_OP_LT_S64:
case FILTER_OP_GE_S64:
case FILTER_OP_LE_S64:
+ {
+ /* Pop 2, push 1 */
+ if (vstack_pop(stack)) {
+ ret = -EINVAL;
+ goto end;
+ }
+ if (!vstack_ax(stack)) {
+ printk(KERN_WARNING "Empty stack\n");
+ ret = -EINVAL;
+ goto end;
+ }
+ switch (vstack_ax(stack)->type) {
+ case REG_S64:
+ case REG_U64:
+ case REG_DOUBLE:
+ case REG_STRING:
+ case REG_STAR_GLOB_STRING:
+ case REG_TYPE_UNKNOWN:
+ break;
+ default:
+ printk(KERN_WARNING "Unexpected register type %d for operation\n",
+ (int) vstack_ax(stack)->type);
+ ret = -EINVAL;
+ goto end;
+ }
+
+ vstack_ax(stack)->type = REG_S64;
+ next_pc += sizeof(struct binary_op);
+ break;
+ }
case FILTER_OP_BIT_RSHIFT:
case FILTER_OP_BIT_LSHIFT:
case FILTER_OP_BIT_AND:
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
case REG_DOUBLE:
case REG_STRING:
case REG_STAR_GLOB_STRING:
goto end;
}
- vstack_ax(stack)->type = REG_S64;
+ vstack_ax(stack)->type = REG_U64;
next_pc += sizeof(struct binary_op);
break;
}
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
case REG_TYPE_UNKNOWN:
break;
default:
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
break;
default:
printk(KERN_WARNING "LTTng: filter: Unexpected register type %d for operation\n",
goto end;
}
- vstack_ax(stack)->type = REG_S64;
next_pc += sizeof(struct unary_op);
break;
}
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
case REG_TYPE_UNKNOWN:
break;
default:
goto end;
}
- vstack_ax(stack)->type = REG_S64;
next_pc += sizeof(struct unary_op);
break;
}
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
case REG_TYPE_UNKNOWN:
break;
case REG_DOUBLE:
goto end;
}
- vstack_ax(stack)->type = REG_S64;
+ vstack_ax(stack)->type = REG_U64;
next_pc += sizeof(struct unary_op);
break;
}
/* There is always a cast-to-s64 operation before a or/and op. */
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
break;
default:
printk(KERN_WARNING "LTTng: filter: Incorrect register type %d for operation\n",
}
switch (vstack_ax(stack)->type) {
case REG_S64:
+ case REG_U64:
case REG_DOUBLE:
case REG_TYPE_UNKNOWN:
break;
case FILTER_OP_LOAD_FIELD_S16:
case FILTER_OP_LOAD_FIELD_S32:
case FILTER_OP_LOAD_FIELD_S64:
+ {
+ /* Pop 1, push 1 */
+ if (!vstack_ax(stack)) {
+ printk(KERN_WARNING "Empty stack\n\n");
+ ret = -EINVAL;
+ goto end;
+ }
+ if (vstack_ax(stack)->type != REG_PTR) {
+ printk(KERN_WARNING "Expecting pointer on top of stack\n\n");
+ ret = -EINVAL;
+ goto end;
+ }
+ vstack_ax(stack)->type = REG_S64;
+ next_pc += sizeof(struct load_op);
+ break;
+ }
case FILTER_OP_LOAD_FIELD_U8:
case FILTER_OP_LOAD_FIELD_U16:
case FILTER_OP_LOAD_FIELD_U32:
ret = -EINVAL;
goto end;
}
- vstack_ax(stack)->type = REG_S64;
+ vstack_ax(stack)->type = REG_U64;
next_pc += sizeof(struct load_op);
break;
}
-
case FILTER_OP_LOAD_FIELD_STRING:
case FILTER_OP_LOAD_FIELD_SEQUENCE:
{