1 #ifndef _FILTER_BYTECODE_H
2 #define _FILTER_BYTECODE_H
7 * LTTng filter bytecode
9 * Copyright 2012-2016 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 #include <lttng/ust-abi.h>
33 * offsets are absolute from start of bytecode.
37 /* Initially, symbol offset. After link, field offset. */
39 } __attribute__((packed
));
41 struct literal_numeric
{
43 } __attribute__((packed
));
45 struct literal_double
{
47 } __attribute__((packed
));
49 struct literal_string
{
51 } __attribute__((packed
));
54 FILTER_OP_UNKNOWN
= 0,
70 /* binary comparators */
78 /* string binary comparator */
86 /* s64 binary comparator */
94 /* double binary comparator */
102 /* Mixed S64-double binary comparators */
103 FILTER_OP_EQ_DOUBLE_S64
,
104 FILTER_OP_NE_DOUBLE_S64
,
105 FILTER_OP_GT_DOUBLE_S64
,
106 FILTER_OP_LT_DOUBLE_S64
,
107 FILTER_OP_GE_DOUBLE_S64
,
108 FILTER_OP_LE_DOUBLE_S64
,
110 FILTER_OP_EQ_S64_DOUBLE
,
111 FILTER_OP_NE_S64_DOUBLE
,
112 FILTER_OP_GT_S64_DOUBLE
,
113 FILTER_OP_LT_S64_DOUBLE
,
114 FILTER_OP_GE_S64_DOUBLE
,
115 FILTER_OP_LE_S64_DOUBLE
,
118 FILTER_OP_UNARY_PLUS
,
119 FILTER_OP_UNARY_MINUS
,
121 FILTER_OP_UNARY_PLUS_S64
,
122 FILTER_OP_UNARY_MINUS_S64
,
123 FILTER_OP_UNARY_NOT_S64
,
124 FILTER_OP_UNARY_PLUS_DOUBLE
,
125 FILTER_OP_UNARY_MINUS_DOUBLE
,
126 FILTER_OP_UNARY_NOT_DOUBLE
,
133 FILTER_OP_LOAD_FIELD_REF
,
134 FILTER_OP_LOAD_FIELD_REF_STRING
,
135 FILTER_OP_LOAD_FIELD_REF_SEQUENCE
,
136 FILTER_OP_LOAD_FIELD_REF_S64
,
137 FILTER_OP_LOAD_FIELD_REF_DOUBLE
,
139 /* load immediate from operand */
140 FILTER_OP_LOAD_STRING
,
142 FILTER_OP_LOAD_DOUBLE
,
145 FILTER_OP_CAST_TO_S64
,
146 FILTER_OP_CAST_DOUBLE_TO_S64
,
149 /* get context ref */
150 FILTER_OP_GET_CONTEXT_REF
,
151 FILTER_OP_GET_CONTEXT_REF_STRING
,
152 FILTER_OP_GET_CONTEXT_REF_S64
,
153 FILTER_OP_GET_CONTEXT_REF_DOUBLE
,
158 typedef uint8_t filter_opcode_t
;
163 /* data to load. Size known by enum filter_opcode and null-term char. */
164 } __attribute__((packed
));
168 } __attribute__((packed
));
172 } __attribute__((packed
));
174 /* skip_offset is absolute from start of bytecode */
177 uint16_t skip_offset
; /* bytecode insn, if skip second test */
178 } __attribute__((packed
));
182 } __attribute__((packed
));
186 } __attribute__((packed
));
188 #endif /* _FILTER_BYTECODE_H */