1 #ifndef _FILTER_BYTECODE_H
2 #define _FILTER_BYTECODE_H
7 * LTTng filter bytecode
9 * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * This library is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License, version 2.1 only,
13 * as published by the Free Software Foundation.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #include <lttng/ust-abi.h>
28 * offsets are absolute from start of bytecode.
32 /* Initially, symbol offset. After link, field offset. */
34 } __attribute__((packed
));
36 struct literal_numeric
{
38 } __attribute__((packed
));
40 struct literal_double
{
42 } __attribute__((packed
));
44 struct literal_string
{
46 } __attribute__((packed
));
49 FILTER_OP_UNKNOWN
= 0,
65 /* binary comparators */
73 /* string binary comparator */
81 /* s64 binary comparator */
89 /* double binary comparator */
97 /* Mixed S64-double binary comparators */
98 FILTER_OP_EQ_DOUBLE_S64
,
99 FILTER_OP_NE_DOUBLE_S64
,
100 FILTER_OP_GT_DOUBLE_S64
,
101 FILTER_OP_LT_DOUBLE_S64
,
102 FILTER_OP_GE_DOUBLE_S64
,
103 FILTER_OP_LE_DOUBLE_S64
,
105 FILTER_OP_EQ_S64_DOUBLE
,
106 FILTER_OP_NE_S64_DOUBLE
,
107 FILTER_OP_GT_S64_DOUBLE
,
108 FILTER_OP_LT_S64_DOUBLE
,
109 FILTER_OP_GE_S64_DOUBLE
,
110 FILTER_OP_LE_S64_DOUBLE
,
113 FILTER_OP_UNARY_PLUS
,
114 FILTER_OP_UNARY_MINUS
,
116 FILTER_OP_UNARY_PLUS_S64
,
117 FILTER_OP_UNARY_MINUS_S64
,
118 FILTER_OP_UNARY_NOT_S64
,
119 FILTER_OP_UNARY_PLUS_DOUBLE
,
120 FILTER_OP_UNARY_MINUS_DOUBLE
,
121 FILTER_OP_UNARY_NOT_DOUBLE
,
128 FILTER_OP_LOAD_FIELD_REF
,
129 FILTER_OP_LOAD_FIELD_REF_STRING
,
130 FILTER_OP_LOAD_FIELD_REF_SEQUENCE
,
131 FILTER_OP_LOAD_FIELD_REF_S64
,
132 FILTER_OP_LOAD_FIELD_REF_DOUBLE
,
134 /* load immediate from operand */
135 FILTER_OP_LOAD_STRING
,
137 FILTER_OP_LOAD_DOUBLE
,
140 FILTER_OP_CAST_TO_S64
,
141 FILTER_OP_CAST_DOUBLE_TO_S64
,
144 /* get context ref */
145 FILTER_OP_GET_CONTEXT_REF
,
146 FILTER_OP_GET_CONTEXT_REF_STRING
,
147 FILTER_OP_GET_CONTEXT_REF_S64
,
148 FILTER_OP_GET_CONTEXT_REF_DOUBLE
,
153 typedef uint8_t filter_opcode_t
;
158 /* data to load. Size known by enum filter_opcode and null-term char. */
159 } __attribute__((packed
));
163 } __attribute__((packed
));
167 } __attribute__((packed
));
169 /* skip_offset is absolute from start of bytecode */
172 uint16_t skip_offset
; /* bytecode insn, if skip second test */
173 } __attribute__((packed
));
177 } __attribute__((packed
));
181 } __attribute__((packed
));
183 #endif /* _FILTER_BYTECODE_H */