projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bytecode: add `REG_U64` interpreter register type
[lttng-ust.git]
/
liblttng-ust
/
lttng-filter-interpreter.c
diff --git
a/liblttng-ust/lttng-filter-interpreter.c
b/liblttng-ust/lttng-filter-interpreter.c
index 6c42b20f1c790838f69fb6c6e1605a8419283f3a..6c77cfe983f97fb02eb8e827166ab0d61087f6e7 100644
(file)
--- a/
liblttng-ust/lttng-filter-interpreter.c
+++ b/
liblttng-ust/lttng-filter-interpreter.c
@@
-220,6
+220,9
@@
LABEL_##name
#endif
#endif
+#define IS_INTEGER_REGISTER(reg_type) \
+ (reg_type == REG_U64 || reg_type == REG_S64)
+
static int context_get_index(struct lttng_ctx *ctx,
struct load_ptr *ptr,
uint32_t idx)
static int context_get_index(struct lttng_ctx *ctx,
struct load_ptr *ptr,
uint32_t idx)
@@
-370,7
+373,7
@@
static int context_get_index(struct lttng_ctx *ctx,
return 0;
}
return 0;
}
-static int dynamic_get_index(struct lttng_
session *session
,
+static int dynamic_get_index(struct lttng_
ctx *ctx
,
struct bytecode_runtime *runtime,
uint64_t index, struct estack_entry *stack_top)
{
struct bytecode_runtime *runtime,
uint64_t index, struct estack_entry *stack_top)
{
@@
-437,9
+440,6
@@
static int dynamic_get_index(struct lttng_session *session,
case LOAD_ROOT_CONTEXT:
case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
{
case LOAD_ROOT_CONTEXT:
case LOAD_ROOT_APP_CONTEXT: /* Fall-through */
{
- struct lttng_ctx *ctx;
-
- ctx = rcu_dereference(session->ctx);
ret = context_get_index(ctx,
&stack_top->u.ptr,
gid->ctx_index);
ret = context_get_index(ctx,
&stack_top->u.ptr,
gid->ctx_index);
@@
-524,7
+524,7
@@
static int dynamic_load_field(struct estack_entry *stack_top)
case OBJECT_TYPE_U8:
dbg_printf("op load field u8\n");
stack_top->u.v = *(uint8_t *) stack_top->u.ptr.ptr;
case OBJECT_TYPE_U8:
dbg_printf("op load field u8\n");
stack_top->u.v = *(uint8_t *) stack_top->u.ptr.ptr;
- stack_top->type = REG_
S
64;
+ stack_top->type = REG_
U
64;
break;
case OBJECT_TYPE_U16:
{
break;
case OBJECT_TYPE_U16:
{
@@
-535,7
+535,7
@@
static int dynamic_load_field(struct estack_entry *stack_top)
if (stack_top->u.ptr.rev_bo)
tmp = bswap_16(tmp);
stack_top->u.v = tmp;
if (stack_top->u.ptr.rev_bo)
tmp = bswap_16(tmp);
stack_top->u.v = tmp;
- stack_top->type = REG_
S
64;
+ stack_top->type = REG_
U
64;
break;
}
case OBJECT_TYPE_U32:
break;
}
case OBJECT_TYPE_U32:
@@
-547,7
+547,7
@@
static int dynamic_load_field(struct estack_entry *stack_top)
if (stack_top->u.ptr.rev_bo)
tmp = bswap_32(tmp);
stack_top->u.v = tmp;
if (stack_top->u.ptr.rev_bo)
tmp = bswap_32(tmp);
stack_top->u.v = tmp;
- stack_top->type = REG_
S
64;
+ stack_top->type = REG_
U
64;
break;
}
case OBJECT_TYPE_U64:
break;
}
case OBJECT_TYPE_U64:
@@
-559,7
+559,7
@@
static int dynamic_load_field(struct estack_entry *stack_top)
if (stack_top->u.ptr.rev_bo)
tmp = bswap_64(tmp);
stack_top->u.v = tmp;
if (stack_top->u.ptr.rev_bo)
tmp = bswap_64(tmp);
stack_top->u.v = tmp;
- stack_top->type = REG_
S
64;
+ stack_top->type = REG_
U
64;
break;
}
case OBJECT_TYPE_DOUBLE:
break;
}
case OBJECT_TYPE_DOUBLE:
@@
-634,7
+634,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
const char *filter_stack_data)
{
struct bytecode_runtime *bytecode = filter_data;
const char *filter_stack_data)
{
struct bytecode_runtime *bytecode = filter_data;
- struct lttng_
session *session = bytecode->p.session
;
+ struct lttng_
ctx *ctx = rcu_dereference(*bytecode->p.pctx)
;
void *pc, *next_pc, *start_pc;
int ret = -EINVAL;
uint64_t retval = 0;
void *pc, *next_pc, *start_pc;
int ret = -EINVAL;
uint64_t retval = 0;
@@
-797,6
+797,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
/* Handle dynamic typing. */
switch (estack_ax_t) {
case REG_S64:
/* Handle dynamic typing. */
switch (estack_ax_t) {
case REG_S64:
+ case REG_U64:
retval = !!estack_ax_v;
break;
case REG_DOUBLE:
retval = !!estack_ax_v;
break;
case REG_DOUBLE:
@@
-830,9
+831,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
switch (estack_bx_t) {
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_EQ_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_EQ_DOUBLE_S64);
JUMP_TO(FILTER_OP_EQ_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_EQ_DOUBLE_S64);
@@
-849,7
+852,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
break;
case REG_DOUBLE:
switch (estack_bx_t) {
break;
case REG_DOUBLE:
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_EQ_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_EQ_DOUBLE);
JUMP_TO(FILTER_OP_EQ_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_EQ_DOUBLE);
@@
-867,6
+871,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64: /* Fall-through */
case REG_DOUBLE:
ret = -EINVAL;
goto end;
case REG_DOUBLE:
ret = -EINVAL;
goto end;
@@
-884,6
+889,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STAR_GLOB_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STAR_GLOB_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64: /* Fall-through */
case REG_DOUBLE:
ret = -EINVAL;
goto end;
case REG_DOUBLE:
ret = -EINVAL;
goto end;
@@
-910,9
+916,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
switch (estack_bx_t) {
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_NE_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_NE_DOUBLE_S64);
JUMP_TO(FILTER_OP_NE_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_NE_DOUBLE_S64);
@@
-929,7
+937,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
break;
case REG_DOUBLE:
switch (estack_bx_t) {
break;
case REG_DOUBLE:
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_NE_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_NE_DOUBLE);
JUMP_TO(FILTER_OP_NE_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_NE_DOUBLE);
@@
-947,6
+956,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64:
case REG_DOUBLE:
ret = -EINVAL;
goto end;
case REG_DOUBLE:
ret = -EINVAL;
goto end;
@@
-964,6
+974,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STAR_GLOB_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STAR_GLOB_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64:
case REG_DOUBLE:
ret = -EINVAL;
goto end;
case REG_DOUBLE:
ret = -EINVAL;
goto end;
@@
-990,9
+1001,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
switch (estack_bx_t) {
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_GT_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GT_DOUBLE_S64);
JUMP_TO(FILTER_OP_GT_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GT_DOUBLE_S64);
@@
-1009,7
+1022,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
break;
case REG_DOUBLE:
switch (estack_bx_t) {
break;
case REG_DOUBLE:
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_GT_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GT_DOUBLE);
JUMP_TO(FILTER_OP_GT_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GT_DOUBLE);
@@
-1027,6
+1041,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64: /* Fall-through */
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
@@
-1051,9
+1066,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
switch (estack_bx_t) {
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_LT_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LT_DOUBLE_S64);
JUMP_TO(FILTER_OP_LT_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LT_DOUBLE_S64);
@@
-1070,7
+1087,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
break;
case REG_DOUBLE:
switch (estack_bx_t) {
break;
case REG_DOUBLE:
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_LT_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LT_DOUBLE);
JUMP_TO(FILTER_OP_LT_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LT_DOUBLE);
@@
-1088,6
+1106,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64: /* Fall-through */
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
@@
-1112,9
+1131,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
switch (estack_bx_t) {
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_GE_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GE_DOUBLE_S64);
JUMP_TO(FILTER_OP_GE_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GE_DOUBLE_S64);
@@
-1131,7
+1152,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
break;
case REG_DOUBLE:
switch (estack_bx_t) {
break;
case REG_DOUBLE:
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_GE_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GE_DOUBLE);
JUMP_TO(FILTER_OP_GE_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_GE_DOUBLE);
@@
-1149,6
+1171,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64: /* Fall-through */
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
@@
-1173,9
+1196,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
switch (estack_bx_t) {
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_LE_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LE_DOUBLE_S64);
JUMP_TO(FILTER_OP_LE_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LE_DOUBLE_S64);
@@
-1192,7
+1217,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
break;
case REG_DOUBLE:
switch (estack_bx_t) {
break;
case REG_DOUBLE:
switch (estack_bx_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through */
+ case REG_U64:
JUMP_TO(FILTER_OP_LE_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LE_DOUBLE);
JUMP_TO(FILTER_OP_LE_S64_DOUBLE);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_LE_DOUBLE);
@@
-1210,6
+1236,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
case REG_STRING:
switch (estack_bx_t) {
case REG_S64: /* Fall-through */
+ case REG_U64: /* Fall-through */
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
case REG_DOUBLE: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
@@
-1593,11
+1620,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
- /* Dynamic typing. */
- if (estack_ax_t != REG_S64 || estack_bx_t != REG_S64) {
+ if (!IS_INTEGER_REGISTER(estack_ax_t) || !IS_INTEGER_REGISTER(estack_bx_t)) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
+
/* Catch undefined behavior. */
if (caa_unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
ret = -EINVAL;
/* Catch undefined behavior. */
if (caa_unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
ret = -EINVAL;
@@
-1606,7
+1633,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
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;
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_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct binary_op);
PO;
}
next_pc += sizeof(struct binary_op);
PO;
}
@@
-1614,11
+1641,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
- /* Dynamic typing. */
- if (estack_ax_t != REG_S64 || estack_bx_t != REG_S64) {
+ if (!IS_INTEGER_REGISTER(estack_ax_t) || !IS_INTEGER_REGISTER(estack_bx_t)) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
+
/* Catch undefined behavior. */
if (caa_unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
ret = -EINVAL;
/* Catch undefined behavior. */
if (caa_unlikely(estack_ax_v < 0 || estack_ax_v >= 64)) {
ret = -EINVAL;
@@
-1627,7
+1654,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
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;
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_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct binary_op);
PO;
}
next_pc += sizeof(struct binary_op);
PO;
}
@@
-1635,8
+1662,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
- /* Dynamic typing. */
- if (estack_ax_t != REG_S64 || estack_bx_t != REG_S64) {
+ if (!IS_INTEGER_REGISTER(estack_ax_t) || !IS_INTEGER_REGISTER(estack_bx_t)) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
@@
-1644,7
+1670,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
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;
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_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct binary_op);
PO;
}
next_pc += sizeof(struct binary_op);
PO;
}
@@
-1652,8
+1678,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
- /* Dynamic typing. */
- if (estack_ax_t != REG_S64 || estack_bx_t != REG_S64) {
+ if (!IS_INTEGER_REGISTER(estack_ax_t) || !IS_INTEGER_REGISTER(estack_bx_t)) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
@@
-1661,7
+1686,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
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;
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_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct binary_op);
PO;
}
next_pc += sizeof(struct binary_op);
PO;
}
@@
-1669,8
+1694,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
int64_t res;
{
int64_t res;
- /* Dynamic typing. */
- if (estack_ax_t != REG_S64 || estack_bx_t != REG_S64) {
+ if (!IS_INTEGER_REGISTER(estack_ax_t) || !IS_INTEGER_REGISTER(estack_bx_t)) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
@@
-1678,7
+1702,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
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;
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_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct binary_op);
PO;
}
next_pc += sizeof(struct binary_op);
PO;
}
@@
-1689,6
+1713,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
/* Dynamic typing. */
switch (estack_ax_t) {
case REG_S64: /* Fall-through. */
/* Dynamic typing. */
switch (estack_ax_t) {
case REG_S64: /* Fall-through. */
+ case REG_U64:
JUMP_TO(FILTER_OP_UNARY_PLUS_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_UNARY_PLUS_DOUBLE);
JUMP_TO(FILTER_OP_UNARY_PLUS_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_UNARY_PLUS_DOUBLE);
@@
-1707,7
+1732,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through. */
+ case REG_U64:
JUMP_TO(FILTER_OP_UNARY_MINUS_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_UNARY_MINUS_DOUBLE);
JUMP_TO(FILTER_OP_UNARY_MINUS_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_UNARY_MINUS_DOUBLE);
@@
-1726,7
+1752,8
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
/* Dynamic typing. */
switch (estack_ax_t) {
{
/* Dynamic typing. */
switch (estack_ax_t) {
- case REG_S64:
+ case REG_S64: /* Fall-through. */
+ case REG_U64:
JUMP_TO(FILTER_OP_UNARY_NOT_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_UNARY_NOT_DOUBLE);
JUMP_TO(FILTER_OP_UNARY_NOT_S64);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_UNARY_NOT_DOUBLE);
@@
-1747,12
+1774,13
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
OP(FILTER_OP_UNARY_BIT_NOT):
{
/* Dynamic typing. */
OP(FILTER_OP_UNARY_BIT_NOT):
{
/* Dynamic typing. */
- if (
estack_ax_t != REG_S64
) {
+ if (
!IS_INTEGER_REGISTER(estack_ax_t)
) {
ret = -EINVAL;
goto end;
}
estack_ax_v = ~(uint64_t) estack_ax_v;
ret = -EINVAL;
goto end;
}
estack_ax_v = ~(uint64_t) estack_ax_v;
+ estack_ax_t = REG_U64;
next_pc += sizeof(struct unary_op);
PO;
}
next_pc += sizeof(struct unary_op);
PO;
}
@@
-1778,6
+1806,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
OP(FILTER_OP_UNARY_NOT_S64):
{
estack_ax_v = !estack_ax_v;
OP(FILTER_OP_UNARY_NOT_S64):
{
estack_ax_v = !estack_ax_v;
+ estack_ax_t = REG_S64;
next_pc += sizeof(struct unary_op);
PO;
}
next_pc += sizeof(struct unary_op);
PO;
}
@@
-1794,7
+1823,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct logical_op *insn = (struct logical_op *) pc;
{
struct logical_op *insn = (struct logical_op *) pc;
- if (estack_ax_t != REG_S64) {
+ if (estack_ax_t != REG_S64
&& estack_ax_t != REG_U64
) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
@@
-1814,7
+1843,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct logical_op *insn = (struct logical_op *) pc;
{
struct logical_op *insn = (struct logical_op *) pc;
- if (estack_ax_t != REG_S64) {
+ if (estack_ax_t != REG_S64
&& estack_ax_t != REG_U64
) {
ret = -EINVAL;
goto end;
}
ret = -EINVAL;
goto end;
}
@@
-1982,6
+2011,9
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
JUMP_TO(FILTER_OP_CAST_NOP);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_CAST_DOUBLE_TO_S64);
JUMP_TO(FILTER_OP_CAST_NOP);
case REG_DOUBLE:
JUMP_TO(FILTER_OP_CAST_DOUBLE_TO_S64);
+ case REG_U64:
+ estack_ax_t = REG_S64;
+ next_pc += sizeof(struct cast_op);
case REG_STRING: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
case REG_STRING: /* Fall-through */
case REG_STAR_GLOB_STRING:
ret = -EINVAL;
@@
-2013,13
+2045,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type dynamic\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type dynamic\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2063,13
+2093,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type string\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type string\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2092,13
+2120,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type s64\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type s64\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2113,13
+2139,11
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx *ctx;
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type double\n",
ref->offset);
struct lttng_ctx_field *ctx_field;
struct lttng_ctx_value v;
dbg_printf("get context ref offset %u type double\n",
ref->offset);
- ctx = rcu_dereference(session->ctx);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
ctx_field = &ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
@@
-2205,7
+2229,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
struct get_index_u16 *index = (struct get_index_u16 *) insn->data;
dbg_printf("op get index u16\n");
struct get_index_u16 *index = (struct get_index_u16 *) insn->data;
dbg_printf("op get index u16\n");
- ret = dynamic_get_index(
session
, bytecode, index->index, estack_ax(stack, top));
+ ret = dynamic_get_index(
ctx
, bytecode, index->index, estack_ax(stack, top));
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
@@
-2220,7
+2244,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
struct get_index_u64 *index = (struct get_index_u64 *) insn->data;
dbg_printf("op get index u64\n");
struct get_index_u64 *index = (struct get_index_u64 *) insn->data;
dbg_printf("op get index u64\n");
- ret = dynamic_get_index(
session
, bytecode, index->index, estack_ax(stack, top));
+ ret = dynamic_get_index(
ctx
, bytecode, index->index, estack_ax(stack, top));
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
if (ret)
goto end;
estack_ax_v = estack_ax(stack, top)->u.v;
@@
-2282,7
+2306,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
dbg_printf("op load field u8\n");
estack_ax_v = *(uint8_t *) estack_ax(stack, top)->u.ptr.ptr;
dbg_printf("op load field u8\n");
estack_ax_v = *(uint8_t *) estack_ax(stack, top)->u.ptr.ptr;
- estack_ax_t = REG_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct load_op);
PO;
}
next_pc += sizeof(struct load_op);
PO;
}
@@
-2291,7
+2315,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
dbg_printf("op load field u16\n");
estack_ax_v = *(uint16_t *) estack_ax(stack, top)->u.ptr.ptr;
dbg_printf("op load field u16\n");
estack_ax_v = *(uint16_t *) estack_ax(stack, top)->u.ptr.ptr;
- estack_ax_t = REG_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct load_op);
PO;
}
next_pc += sizeof(struct load_op);
PO;
}
@@
-2300,7
+2324,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
dbg_printf("op load field u32\n");
estack_ax_v = *(uint32_t *) estack_ax(stack, top)->u.ptr.ptr;
dbg_printf("op load field u32\n");
estack_ax_v = *(uint32_t *) estack_ax(stack, top)->u.ptr.ptr;
- estack_ax_t = REG_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct load_op);
PO;
}
next_pc += sizeof(struct load_op);
PO;
}
@@
-2309,7
+2333,7
@@
uint64_t lttng_filter_interpret_bytecode(void *filter_data,
dbg_printf("op load field u64\n");
estack_ax_v = *(uint64_t *) estack_ax(stack, top)->u.ptr.ptr;
dbg_printf("op load field u64\n");
estack_ax_v = *(uint64_t *) estack_ax(stack, top)->u.ptr.ptr;
- estack_ax_t = REG_
S
64;
+ estack_ax_t = REG_
U
64;
next_pc += sizeof(struct load_op);
PO;
}
next_pc += sizeof(struct load_op);
PO;
}
This page took
0.033904 seconds
and
4
git commands to generate.