X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Ffilter%2Ffilter-bytecode.h;h=b7b71ad538ad7de884bddf284b2532e09670851a;hp=06dace84c7dbadc514763bf472502a21248ae2c4;hb=661dfdd190c65bad5a044e21c1d5f9ad59144bf8;hpb=7e6831d1a223d5e96609c505a6437da4af587be4 diff --git a/src/lib/lttng-ctl/filter/filter-bytecode.h b/src/lib/lttng-ctl/filter/filter-bytecode.h index 06dace84c..b7b71ad53 100644 --- a/src/lib/lttng-ctl/filter/filter-bytecode.h +++ b/src/lib/lttng-ctl/filter/filter-bytecode.h @@ -33,19 +33,25 @@ struct field_ref { /* Initially, symbol offset. After link, field offset. */ uint16_t offset; -} __attribute__((packed)); +} LTTNG_PACKED; + +struct field_ref_index { + /* Initially, symbol offset. After link, field offset. */ + uint16_t offset; + uint64_t index; /* array index */ +} LTTNG_PACKED; struct literal_numeric { int64_t v; -} __attribute__((packed)); +} LTTNG_PACKED; struct literal_double { double v; -} __attribute__((packed)); +} LTTNG_PACKED; struct literal_string { char string[0]; -} __attribute__((packed)); +} LTTNG_PACKED; enum filter_op { FILTER_OP_UNKNOWN = 0, @@ -72,7 +78,7 @@ enum filter_op { FILTER_OP_GE = 16, FILTER_OP_LE = 17, - /* string binary comparator */ + /* string binary comparator: apply to */ FILTER_OP_EQ_STRING = 18, FILTER_OP_NE_STRING = 19, FILTER_OP_GT_STRING = 20, @@ -126,13 +132,14 @@ enum filter_op { FILTER_OP_AND = 57, FILTER_OP_OR = 58, - /* load */ + /* load field ref */ FILTER_OP_LOAD_FIELD_REF = 59, FILTER_OP_LOAD_FIELD_REF_STRING = 60, FILTER_OP_LOAD_FIELD_REF_SEQUENCE = 61, FILTER_OP_LOAD_FIELD_REF_S64 = 62, FILTER_OP_LOAD_FIELD_REF_DOUBLE = 63, + /* load immediate from operand */ FILTER_OP_LOAD_STRING = 64, FILTER_OP_LOAD_S64 = 65, FILTER_OP_LOAD_DOUBLE = 66, @@ -142,6 +149,34 @@ enum filter_op { FILTER_OP_CAST_DOUBLE_TO_S64 = 68, FILTER_OP_CAST_NOP = 69, + /* get context ref */ + FILTER_OP_GET_CONTEXT_REF = 70, + FILTER_OP_GET_CONTEXT_REF_STRING = 71, + FILTER_OP_GET_CONTEXT_REF_S64 = 72, + FILTER_OP_GET_CONTEXT_REF_DOUBLE = 73, + + /* load userspace field ref */ + FILTER_OP_LOAD_FIELD_REF_USER_STRING = 74, + FILTER_OP_LOAD_FIELD_REF_USER_SEQUENCE = 75, + + /* + * load immediate star globbing pattern (literal string) + * from immediate + */ + FILTER_OP_LOAD_STAR_GLOB_STRING = 76, + + /* globbing pattern binary operator: apply to */ + FILTER_OP_EQ_STAR_GLOB_STRING = 77, + FILTER_OP_NE_STAR_GLOB_STRING = 78, + + /* load field ref with index */ + FILTER_OP_LOAD_FIELD_REF_INDEX = 79, + FILTER_OP_LOAD_FIELD_REF_INDEX_S64 = 80, + + /* get context ref with index */ + FILTER_OP_GET_CONTEXT_REF_INDEX = 81, + FILTER_OP_GET_CONTEXT_REF_INDEX_S64 = 82, + NR_FILTER_OPS, }; @@ -151,29 +186,29 @@ struct load_op { filter_opcode_t op; char data[0]; /* data to load. Size known by enum filter_opcode and null-term char. */ -} __attribute__((packed)); +} LTTNG_PACKED; struct binary_op { filter_opcode_t op; -} __attribute__((packed)); +} LTTNG_PACKED; struct unary_op { filter_opcode_t op; -} __attribute__((packed)); +} LTTNG_PACKED; /* skip_offset is absolute from start of bytecode */ struct logical_op { filter_opcode_t op; uint16_t skip_offset; /* bytecode insn, if skip second test */ -} __attribute__((packed)); +} LTTNG_PACKED; struct cast_op { filter_opcode_t op; -} __attribute__((packed)); +} LTTNG_PACKED; struct return_op { filter_opcode_t op; -} __attribute__((packed)); +} LTTNG_PACKED; struct lttng_filter_bytecode_alloc { uint32_t alloc_len;