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
26 * offsets are absolute from start of bytecode.
30 /* Initially, symbol offset. After link, field offset. */
32 } __attribute__((packed
));
34 struct literal_numeric
{
36 } __attribute__((packed
));
38 struct literal_double
{
40 } __attribute__((packed
));
42 struct literal_string
{
44 } __attribute__((packed
));
47 FILTER_OP_UNKNOWN
= 0,
63 /* binary comparators */
71 /* string binary comparator */
79 /* s64 binary comparator */
87 /* double binary comparator */
95 /* Mixed S64-double binary comparators */
96 FILTER_OP_EQ_DOUBLE_S64
,
97 FILTER_OP_NE_DOUBLE_S64
,
98 FILTER_OP_GT_DOUBLE_S64
,
99 FILTER_OP_LT_DOUBLE_S64
,
100 FILTER_OP_GE_DOUBLE_S64
,
101 FILTER_OP_LE_DOUBLE_S64
,
103 FILTER_OP_EQ_S64_DOUBLE
,
104 FILTER_OP_NE_S64_DOUBLE
,
105 FILTER_OP_GT_S64_DOUBLE
,
106 FILTER_OP_LT_S64_DOUBLE
,
107 FILTER_OP_GE_S64_DOUBLE
,
108 FILTER_OP_LE_S64_DOUBLE
,
111 FILTER_OP_UNARY_PLUS
,
112 FILTER_OP_UNARY_MINUS
,
114 FILTER_OP_UNARY_PLUS_S64
,
115 FILTER_OP_UNARY_MINUS_S64
,
116 FILTER_OP_UNARY_NOT_S64
,
117 FILTER_OP_UNARY_PLUS_DOUBLE
,
118 FILTER_OP_UNARY_MINUS_DOUBLE
,
119 FILTER_OP_UNARY_NOT_DOUBLE
,
126 FILTER_OP_LOAD_FIELD_REF
,
127 FILTER_OP_LOAD_FIELD_REF_STRING
,
128 FILTER_OP_LOAD_FIELD_REF_SEQUENCE
,
129 FILTER_OP_LOAD_FIELD_REF_S64
,
130 FILTER_OP_LOAD_FIELD_REF_DOUBLE
,
132 /* load immediate from operand */
133 FILTER_OP_LOAD_STRING
,
135 FILTER_OP_LOAD_DOUBLE
,
138 FILTER_OP_CAST_TO_S64
,
139 FILTER_OP_CAST_DOUBLE_TO_S64
,
142 /* get context ref */
143 FILTER_OP_GET_CONTEXT_REF
,
144 FILTER_OP_GET_CONTEXT_REF_STRING
,
145 FILTER_OP_GET_CONTEXT_REF_S64
,
146 FILTER_OP_GET_CONTEXT_REF_DOUBLE
,
148 /* load userspace field ref */
149 FILTER_OP_LOAD_FIELD_REF_USER_STRING
,
150 FILTER_OP_LOAD_FIELD_REF_USER_SEQUENCE
,
155 typedef uint8_t filter_opcode_t
;
160 /* data to load. Size known by enum filter_opcode and null-term char. */
161 } __attribute__((packed
));
165 } __attribute__((packed
));
169 } __attribute__((packed
));
171 /* skip_offset is absolute from start of bytecode */
174 uint16_t skip_offset
; /* bytecode insn, if skip second test */
175 } __attribute__((packed
));
179 } __attribute__((packed
));
183 } __attribute__((packed
));
185 #endif /* _FILTER_BYTECODE_H */