Filter: ensure logical operator merge is always s64
[lttng-tools.git] / src / lib / lttng-ctl / filter-bytecode.h
index af0733076a473201edd6ca94d032342ffe71b9ad..1bb00dd4577afe0f095c92b375e53eab5c40f41d 100644 (file)
@@ -35,23 +35,19 @@ enum filter_register {
        REG_ERROR,
 };
 
-enum field_ref_type {
-       FIELD_REF_UNKNOWN = 0,
-       FIELD_REF_STRING,
-       FIELD_REF_SEQUENCE,
-       FIELD_REF_S64,
-};
-
 struct field_ref {
        /* Initially, symbol offset. After link, field offset. */
        uint16_t offset;
-       uint8_t type;   /* enum field_ref_type */
 } __attribute__((packed));
 
 struct literal_numeric {
        int64_t v;
 } __attribute__((packed));
 
+struct literal_double {
+       double v;
+} __attribute__((packed));
+
 struct literal_string {
        char string[0];
 } __attribute__((packed));
@@ -72,6 +68,8 @@ enum filter_op {
        FILTER_OP_BIN_AND,
        FILTER_OP_BIN_OR,
        FILTER_OP_BIN_XOR,
+
+       /* binary comparators */
        FILTER_OP_EQ,
        FILTER_OP_NE,
        FILTER_OP_GT,
@@ -79,10 +77,40 @@ enum filter_op {
        FILTER_OP_GE,
        FILTER_OP_LE,
 
+       /* string binary comparator */
+       FILTER_OP_EQ_STRING,
+       FILTER_OP_NE_STRING,
+       FILTER_OP_GT_STRING,
+       FILTER_OP_LT_STRING,
+       FILTER_OP_GE_STRING,
+       FILTER_OP_LE_STRING,
+
+       /* s64 binary comparator */
+       FILTER_OP_EQ_S64,
+       FILTER_OP_NE_S64,
+       FILTER_OP_GT_S64,
+       FILTER_OP_LT_S64,
+       FILTER_OP_GE_S64,
+       FILTER_OP_LE_S64,
+
+       /* double binary comparator */
+       FILTER_OP_EQ_DOUBLE,
+       FILTER_OP_NE_DOUBLE,
+       FILTER_OP_GT_DOUBLE,
+       FILTER_OP_LT_DOUBLE,
+       FILTER_OP_GE_DOUBLE,
+       FILTER_OP_LE_DOUBLE,
+
        /* unary */
        FILTER_OP_UNARY_PLUS,
        FILTER_OP_UNARY_MINUS,
        FILTER_OP_UNARY_NOT,
+       FILTER_OP_UNARY_PLUS_S64,
+       FILTER_OP_UNARY_MINUS_S64,
+       FILTER_OP_UNARY_NOT_S64,
+       FILTER_OP_UNARY_PLUS_DOUBLE,
+       FILTER_OP_UNARY_MINUS_DOUBLE,
+       FILTER_OP_UNARY_NOT_DOUBLE,
 
        /* logical */
        FILTER_OP_AND,
@@ -90,8 +118,19 @@ enum filter_op {
 
        /* load */
        FILTER_OP_LOAD_FIELD_REF,
+       FILTER_OP_LOAD_FIELD_REF_STRING,
+       FILTER_OP_LOAD_FIELD_REF_SEQUENCE,
+       FILTER_OP_LOAD_FIELD_REF_S64,
+       FILTER_OP_LOAD_FIELD_REF_DOUBLE,
+
        FILTER_OP_LOAD_STRING,
        FILTER_OP_LOAD_S64,
+       FILTER_OP_LOAD_DOUBLE,
+
+       /* cast */
+       FILTER_OP_CAST_TO_S64,
+       FILTER_OP_CAST_DOUBLE_TO_S64,
+       FILTER_OP_CAST_NOP,
 
        NR_FILTER_OPS,
 };
@@ -120,6 +159,11 @@ struct logical_op {
        uint16_t skip_offset;   /* bytecode insn, if skip second test */
 } __attribute__((packed));
 
+struct cast_op {
+       filter_opcode_t op;
+       uint8_t reg;            /* enum filter_register */
+} __attribute__((packed));
+
 struct return_op {
        filter_opcode_t op;
 } __attribute__((packed));
This page took 0.024076 seconds and 4 git commands to generate.